Пример #1
0
 internal void FlagSpot(FieldSpot spot)
 {
     spot.IsFlagged = !spot.IsFlagged;
     SetTextForField(spot);
     UpdateGameState();
 }
Пример #2
0
 private int GetNeighborBombCount(FieldSpot spot)
 {
     if (spot.CachedBombNeighborCount != null)
         return spot.CachedBombNeighborCount.Value;
     return 0;
 }
Пример #3
0
 internal void ClearSpot(FieldSpot spot)
 {
     spot.IsCleared = true;
     SetTextForField(spot);
     UpdateGameState();
 }
Пример #4
0
 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;
 }