예제 #1
0
파일: Field.cs 프로젝트: Isgeny/BattleCity
        public Field(GUIForm guiForm, Rectangle rect, GameForm gameForm) : base(guiForm, rect)
        {
            _gameForm      = gameForm;
            Obstacles      = new List <Obstacle>();
            PlayersManager = new PlayersManager(guiForm, this);
            CompsManager   = new CompsManager(guiForm, this);
            BonusManager   = new BonusManager(guiForm, this);
            Shells         = new List <Shell>();

            _showelDelayTimer          = new Timer();
            _showelDelayTimer.Interval = 20 * 1000;
            _showelDelayTimer.Tick    += OnShowelDelayTimerTick;

            _watchDelayTimer          = new Timer();
            _watchDelayTimer.Interval = 10 * 1000;
            _watchDelayTimer.Tick    += OnWatchDelayTimerTick;
        }
예제 #2
0
파일: Field.cs 프로젝트: Isgeny/BattleCity
        public override void Unsubscribe()
        {
            GUIForm.Paint -= OnPaint;

            UnsubscribeObstacles(Obstacles);

            PlayersManager.Unsubscribe();
            PlayersManager.TankShot       -= OnShot;
            PlayersManager.TanksDestroyed -= OnPlayerTanksOrHQDestroyed;

            CompsManager.Unsubscribe();
            CompsManager.TankShot       -= OnShot;
            CompsManager.TanksDestroyed -= OnCompTanksDestroyed;

            BonusManager.Unsubscribe();
            BonusManager.PlayerTookBomb   -= OnPlayerTookBomb;
            BonusManager.CompTookBomb     -= OnCompTookBomb;
            BonusManager.PlayerTookWatch  -= OnPlayerTookWatch;
            BonusManager.CompTookWatch    -= OnCompTookWatch;
            BonusManager.PlayerTookShowel -= OnPlayerTookShowel;
            BonusManager.CompTookShowel   -= OnCompTookShowel;
        }
예제 #3
0
파일: Field.cs 프로젝트: Isgeny/BattleCity
        public override void Subscribe()
        {
            GUIForm.Paint += OnPaint;

            SubscribeObstacles(Obstacles);

            PlayersManager.Subscribe();
            PlayersManager.TankShot       += OnShot;
            PlayersManager.TanksDestroyed += OnPlayerTanksOrHQDestroyed;

            CompsManager.Subscribe();
            CompsManager.TankShot       += OnShot;
            CompsManager.TanksDestroyed += OnCompTanksDestroyed;

            BonusManager.Subscribe();
            BonusManager.PlayerTookBomb   += OnPlayerTookBomb;
            BonusManager.CompTookBomb     += OnCompTookBomb;
            BonusManager.PlayerTookWatch  += OnPlayerTookWatch;
            BonusManager.CompTookWatch    += OnCompTookWatch;
            BonusManager.PlayerTookShowel += OnPlayerTookShowel;
            BonusManager.CompTookShowel   += OnCompTookShowel;
        }