Ejemplo n.º 1
0
        public Game Create()
        {
            var gameTimeService        = new GameTimeService(30);
            var gameLoop               = new GameEventQueueService(gameTimeService);
            var terrainServiceStore    = new SectorGraphDescriptionStore();
            var terrainSnapshotBuilder = new TerrainSnapshotCompiler(terrainServiceStore);
            var terrainService         = new TerrainService(terrainServiceStore, terrainSnapshotBuilder);
            var entityService          = new EntityService();
            var statsCalculator        = new StatsCalculator();
            var pathfinderCalculator   = new PathfinderCalculator(terrainService, statsCalculator);
            var movementSystemService  = new MovementSystemService(entityService, gameTimeService, statsCalculator, terrainService, pathfinderCalculator);

            entityService.AddEntitySystem(movementSystemService);
            var gameLogicFacade = new GameLogicFacade(terrainService, movementSystemService);
            var gameInstance    = new Game {
                GameTimeService       = gameTimeService,
                GameEventQueueService = gameLoop,
                TerrainService        = terrainService,
                EntityService         = entityService,
                PathfinderCalculator  = pathfinderCalculator,
                MovementSystemService = movementSystemService,
                GameLogicFacade       = gameLogicFacade
            };

            gameInstance.Initialize();
            GameCreated?.Invoke(this, gameInstance);
            return(gameInstance);
        }
Ejemplo n.º 2
0
 public RemoveTemporaryHoleGameEvent(GameTime time, GameLogicFacade gameLogicFacade, DynamicTerrainHoleDescription dynamicTerrainHoleDescription) : base(time)
 {
     this.gameLogicFacade = gameLogicFacade;
     this.dynamicTerrainHoleDescription = dynamicTerrainHoleDescription;
 }
 public GameController(DBContext context)
 {
     this.context         = context;
     this.gameLogicFacade = new GameLogicFacade(context);
 }