Пример #1
0
        public Game()
        {
            PlayerManager = new PlayerManager();
            collisionManager = new CollisionManager();
            shipManager = new ShipManager(collisionManager);
            bulletManager = new BulletManager(collisionManager);

            gameStateManager = new GameStateManager();

            updateTimer = new Timer(1000 / updatesPerSecond);
            updateTimer.AutoReset = true;
            updateTimer.Elapsed += updateTimer_Elapsed;
            updateTimer.Start();

            drawTimer = new Timer(1000 / drawsPerSecond);
            drawTimer.AutoReset = true;
            drawTimer.Elapsed += drawTimer_Elapsed;
            drawTimer.Start();
        }
Пример #2
0
 public ShipManager(CollisionManager collisionManager)
 {
     Ships = new ConcurrentDictionary<string, Ship>();
     this.collisionManager = collisionManager;
 }
Пример #3
0
 public BulletManager(CollisionManager collisionManager)
 {
     Bullets = new List<Bullet>();
     this.collisionManager = collisionManager;
 }