~angus.helm/terrella/trunk

« back to all changes in this revision

Viewing changes to Terrella/Battle/GameMode.cs

  • Committer: Angus Helm
  • Author(s):
  • Date: 2010-09-22 02:47:56 UTC
  • Revision ID: angus@angushelm.com-20100922024756-czuh9mmdt278n3y6
Converted to Ninject, started on battle map work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
using Terrella;
24
24
using Tao.OpenGl;
25
25
using SdlDotNet.Input;
 
26
using Ninject;
26
27
 
27
28
namespace Terrella.Battle
28
29
{
29
 
    class GameMode : Terrella.GameMode
 
30
    public class GameMode : Terrella.GameMode
30
31
    {
31
32
        private Direction cameraAngle = new Direction(45.0);
32
33
        private double cameraDistance = 1000.0;
236
237
            }
237
238
        }
238
239
 
239
 
        public GameMode(WorldMap.GameMode gm)
 
240
        public GameMode(WorldMap.GameMode gm, Map m)
240
241
        {
241
242
            this.oldWorldMapMode = gm;
242
 
            this.map = new Map();
 
243
            this.map = m;
243
244
        }
244
245
 
245
246
        public Map map { get; private set; }
246
247
    }
 
248
 
 
249
    public class BattleGameModeFactory
 
250
    {
 
251
        private FSResources Resources;
 
252
        private BattleMapGenerator MapGenerator;
 
253
 
 
254
        [Inject]
 
255
        public BattleGameModeFactory(FSResources resources, BattleMapGenerator bmg)
 
256
        {
 
257
            this.Resources = resources;
 
258
            this.MapGenerator = bmg;
 
259
        }
 
260
 
 
261
        public GameMode Create(WorldMap.GameMode oldGameMode, string maptype)
 
262
        {
 
263
            return new GameMode(oldGameMode, this.MapGenerator.GetMap(maptype));
 
264
        }
 
265
    }
247
266
}