Beispiel #1
0
        public GameManager(
            GameSettings gameSettings,
            IInputHandler keyboardHandler,
            SocketManager socketManager,
            IGraphicsHandler graphics)
        {
            this.gameSettings = gameSettings;
            this.graphics = graphics;
            const int ticksPerSecond = 30;
            gameLoop = new GameLoop(5, ticksPerSecond);
            gameLoop.Update += Update;
            gameLoop.Render += Render;

            Map map = new Map(gameSettings.Map);
            world = new World(map);

            int countShip = 0;
            List<Bumpership> bumperships = gameSettings.Players.Take(world.Map.StartPositions.Count)
                .Select(p => CreateBumpership(p, keyboardHandler, socketManager, ref countShip))
                .ToList();
            world.AddShips(bumperships);
        }
Beispiel #2
0
 public World(Map map)
 {
     this.map = map;
 }