Implement Change Detection Drawing
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user