Implement Change Detection Drawing

This commit is contained in:
Marvin Rohrbach
2018-12-15 16:07:03 +01:00
parent e7fda99c11
commit e0a05da06e
5 changed files with 81 additions and 20 deletions

View File

@@ -21,20 +21,34 @@ namespace CoopSweeper.GameTypes
public int CheckID { get; set; }
public DisplayState GetDisplayState()
public DisplayState DisplayState
{
switch(State)
get
{
case FieldState.QUESTIONMARK:
case FieldState.NONE:
case FieldState.FLAG:
switch (State)
{
case FieldState.QUESTIONMARK:
case FieldState.NONE:
case FieldState.FLAG:
return (DisplayState)State;
case FieldState.REVEALED:
if(ContainsBomb)
return DisplayState.BOMB;
return (DisplayState)SurroundingBombs;
case FieldState.REVEALED:
if (ContainsBomb)
return DisplayState.BOMB;
return (DisplayState)SurroundingBombs;
}
return DisplayState.ERROR;
}
return DisplayState.ERROR;
}
public IField Clone()
{
return new Field()
{
State = State,
ContainsBomb = ContainsBomb,
SurroundingBombs = SurroundingBombs,
CheckID = CheckID
};
}
}
}