Beispiel #1
0
        public static void loadGame()
        {
            DataHandler.loadFromJSON();
            lastMove = null;
            boardWindow.repaint();

            if (turn == "black")
            {
                turn = "white";
                nextPlayer();
            }
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);

        }