public void Notify(Cell changedCell) { PlayerOneListener.Update(IsPlayerOneTurn, changedCell); PlayerTwoListener.Update(!IsPlayerOneTurn, changedCell); //don`t change turn if ship got hit if (changedCell.CellState != CellState.DamagedShip) { IsPlayerOneTurn = !IsPlayerOneTurn; } }
public void Notify() { if (IsPlayerOneTurn) { PlayerOneListener.Update("You have won!"); PlayerTwoListener.Update("You are loser, чел."); } else { PlayerTwoListener.Update("You have won!"); PlayerOneListener.Update("You are loser, чел."); } }
public void Notify(Exception exception) { if (IsPlayerOneTurn) { PlayerOneListener.Update("ERROR: " + exception.Message + " Try again."); PlayerTwoListener.Update(""); } else { PlayerTwoListener.Update("ERROR: " + exception.Message + " Try again."); PlayerOneListener.Update(""); } }