private string GetDescriptionForTurn(PlayerTurnSnapshot snapshot) { if (snapshot.OldCellState.IsFlagged != snapshot.NewCellState.IsFlagged) { var newFlagged = snapshot.NewCellState.IsFlagged ? "Flagged" : "Not Flagged"; var oldFlagged = snapshot.OldCellState.IsFlagged ? "Flagged" : "Not Flagged"; return($"{oldFlagged}->{newFlagged}"); } if (snapshot.OldCellState.IsOpen != snapshot.NewCellState.IsOpen) { if (snapshot.NewCellState.IsMine) { return("Caught a mine :("); } return("Closed->Opened"); } return("Unknown"); }
public void OnPlayerTurn(MineFieldSnapshot mineFieldSnapshot, PlayerTurnSnapshot playerTurnSnapshot, float time) { Container.AddTurn(mineFieldSnapshot, playerTurnSnapshot, GetDescriptionForTurn(playerTurnSnapshot), time); }