public Result Attack(Player attacker, Square s) { if (!s.WasBombed && turn == attacker) { Result r = s.Bomb(); if (r == Result.Miss) { SwitchTurns(); } else if (r == Result.ShipDestroyed) { turn.ShipDestroyed(); if (turn.HasLost()) { return(Result.Victory); } } return(r); } return(Result.None); }
public void Attack() { clicked = true; s.Bomb(); if (this.s.GetShip() == null) { this.Image = Properties.Resources.empty; } else { this.Image = Properties.Resources.bombed; } }