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); }
private void OnShot(object sender, ShellEventArgs e) { InvokeTankShot(e); }
private void InvokeTankShot(ShellEventArgs e) { TankShot?.Invoke(this, e); }
protected void InvokeShot(ShellEventArgs e) { Shot?.Invoke(this, e); }