public static void loadGame() { DataHandler.loadFromJSON(); lastMove = null; boardWindow.repaint(); if (turn == "black") { turn = "white"; nextPlayer(); } }
public void newGame(string loadedGamePath) { menu.Hide(); gamePath = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\ChessMate"; lastMove = null; computerMove = null; turn = "white"; board = new Board(); boardWindow = new BoardWindow(); boardWindow.Show(); boardWindow.Closing += ExitGame; boardWindow.repaint(); if (loadedGamePath.Equals("INVALID_PATH")) { DataHandler.writeToJSON(); } are = new AutoResetEvent(true); t = new Timer(checkforchange, are, 1000, 5000); }