Add colorcoded rendering

This commit is contained in:
Marvin Rohrbach
2018-05-25 11:25:41 +02:00
parent c82c40a577
commit fee6a87f54
3 changed files with 94 additions and 21 deletions

View File

@@ -16,19 +16,20 @@ namespace CoopSweeper.GameTypes
public FieldState State { get; set; }
public char ToChar()
public DisplayState GetDisplayState()
{
switch(State)
{
case FieldState.FLAG: return 'F';
case FieldState.NONE: return '◌';
case FieldState.QUESTIONMARK: return '?';
case FieldState.QUESTIONMARK:
case FieldState.NONE:
case FieldState.FLAG:
return (DisplayState)State;
case FieldState.REVEALED:
if(ContainsBomb)
return '☼';
return ' ';
return DisplayState.BOMB;
return 0;
}
return 'E';
return DisplayState.ERROR;
}
}
}