Files
minesweeper-coop/CoopSweeper/GameTypes/Field.cs
2018-05-25 11:25:41 +02:00

36 lines
815 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace CoopSweeper.GameTypes
{
class Field : IField
{
public Field()
{
State = FieldState.NONE;
}
public bool ContainsBomb { get; set; }
public FieldState State { 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;
}
}
}