internal void FlagSpot(FieldSpot spot) { spot.IsFlagged = !spot.IsFlagged; SetTextForField(spot); UpdateGameState(); }
private int GetNeighborBombCount(FieldSpot spot) { if (spot.CachedBombNeighborCount != null) return spot.CachedBombNeighborCount.Value; return 0; }
internal void ClearSpot(FieldSpot spot) { spot.IsCleared = true; SetTextForField(spot); UpdateGameState(); }
internal void SetTextForField(FieldSpot spot) { // note ordre is somewhat important if (spot.IsBomb) spot.Text = "X"; else if (spot.IsFlagged) spot.Text = "F"; else if (spot.IsCleared) spot.Text = "C"; else spot.Text = string.Empty; }