Esempio n. 1
0
        private void OnShot(object sender, ShellEventArgs e)
        {
            var shell = e.Shell;

            shell.Destroyed     += OnShellDestroyed;
            shell.CheckPosition += OnCheckPosition;
            foreach (var obstacle in Obstacles)
            {
                if (!(obstacle is Water) && !(obstacle is Ice))
                {
                    shell.CheckPosition += obstacle.GetCheckPositionListener();
                }
            }
            foreach (var listShell in Shells)
            {
                listShell.CheckPosition += shell.GetCheckPositionListener();
            }

            foreach (var playerTank in PlayersManager.Tanks)
            {
                shell.CheckPosition += playerTank.GetCheckPositionListener();
            }

            foreach (var compTankOnField in CompsManager.TanksOnField)
            {
                shell.CheckPosition += compTankOnField.GetCheckPositionListener();
            }

            Shells.Add(shell);
        }
Esempio n. 2
0
 private void OnShot(object sender, ShellEventArgs e)
 {
     InvokeTankShot(e);
 }
Esempio n. 3
0
 private void InvokeTankShot(ShellEventArgs e)
 {
     TankShot?.Invoke(this, e);
 }
Esempio n. 4
0
 protected void InvokeShot(ShellEventArgs e)
 {
     Shot?.Invoke(this, e);
 }