using System; using System.Collections.Generic; using System.Text; namespace CoopSweeper.GameTypes { class Field : IField { public Field() { State = FieldState.NONE; CheckID = 0; } public bool ContainsBomb { get; set; } public FieldState State { get; set; } public int SurroundingBombs { get; set; } public int CheckID { get; set; } public DisplayState GetDisplayState() { switch(State) { case FieldState.QUESTIONMARK: case FieldState.NONE: case FieldState.FLAG: return (DisplayState)State; case FieldState.REVEALED: if(ContainsBomb) return DisplayState.BOMB; return 0; } return DisplayState.ERROR; } } }