//Constructor for the GameEngine class private GameEngine(Size sizeOfDrawing) { _bitmap = new Bitmap(sizeOfDrawing.Width, sizeOfDrawing.Height); _graphics = Graphics.FromImage(_bitmap); eColour = EColour.UNSET; bWhiteTurn = true; StartGame(); }
//Set the color that the player can move public void SetColour(bool bIsWhite) { if (bIsWhite) { eColour = EColour.WHITE; } else { eColour = EColour.BLACK; } }
static char ColourToChar(EColour colour) { switch (colour) { case EColour.White: return 'W'; case EColour.Blue: return 'U'; case EColour.Black: return 'B'; case EColour.Red: return 'R'; case EColour.Green: return 'G'; } return 'X'; }
public static string printEColour(EColour colour) { return Enum.GetName(typeof(EColour), colour); }
//Reset the game state, and start the whole game over again public void ResetGame() { eColour = EColour.UNSET; bWhiteTurn = true; StartGame(); }