Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }