private static void Actually_StartGame(params object[] eventArgs) { if (!_isInGameMode) { _isInGameMode = true; UvsChess.Framework.ChessState item = Actually_GetUpdated_LstHistory_SelectedItem(); _mainGame = new UvsChess.Framework.ChessGame(item, GuiEventLoop.WhitePlayerName, GuiEventLoop.BlackPlayerName); // Remove WinGui from the GuiChessBoard updates MainForm.chessBoardControl.PieceMovedByHuman -= MainForm.PieceMovedByHuman_Changed; // Add the ChessGame to the GuiChessBoard updates MainForm.chessBoardControl.PieceMovedByHuman += _mainGame.WhitePlayer_HumanMovedPieceEvent; MainForm.chessBoardControl.PieceMovedByHuman += _mainGame.BlackPlayer_HumanMovedPieceEvent; // Add WinGui to the ChessGame updates event _mainGame.UpdatedState += GuiEventLoop.AddToHistory; _mainGame.SetGuiChessBoard_IsLocked += GuiEventLoop.SetGuiChessBoard_IsLocked; // Add WinGui to the DeclareResults event _mainGame.DeclareResults += GuiEventLoop.DeclareResults; _mainGame.SetDecisionTree += GuiEventLoop.SetDecisionTree; Actually_RemoveHistoryAfterSelected(); Actually_DisableMenuItemsDuringPlay(); Actually_DisableRadioBtnsAndComboBoxes(); Actually_DisableHistoryWindowClicking(); GuiEventLoop.Actually_SetGuiChessBoard_IsLocked(new object[] { true }); _mainGame.StartGame(); } }
private static void Actually_StartGame(params object[] eventArgs) { if (! _isInGameMode) { _isInGameMode = true; UvsChess.Framework.ChessState item = Actually_GetUpdated_LstHistory_SelectedItem(); _mainGame = new UvsChess.Framework.ChessGame(item, GuiEventLoop.WhitePlayerName, GuiEventLoop.BlackPlayerName); // Remove WinGui from the GuiChessBoard updates MainForm.chessBoardControl.PieceMovedByHuman -= MainForm.PieceMovedByHuman_Changed; // Add the ChessGame to the GuiChessBoard updates MainForm.chessBoardControl.PieceMovedByHuman += _mainGame.WhitePlayer_HumanMovedPieceEvent; MainForm.chessBoardControl.PieceMovedByHuman += _mainGame.BlackPlayer_HumanMovedPieceEvent; // Add WinGui to the ChessGame updates event _mainGame.UpdatedState += GuiEventLoop.AddToHistory; _mainGame.SetGuiChessBoard_IsLocked += GuiEventLoop.SetGuiChessBoard_IsLocked; // Add WinGui to the DeclareResults event _mainGame.DeclareResults += GuiEventLoop.DeclareResults; _mainGame.SetDecisionTree += GuiEventLoop.SetDecisionTree; Actually_RemoveHistoryAfterSelected(); Actually_DisableMenuItemsDuringPlay(); Actually_DisableRadioBtnsAndComboBoxes(); Actually_DisableHistoryWindowClicking(); GuiEventLoop.Actually_SetGuiChessBoard_IsLocked(new object[] { true }); _mainGame.StartGame(); } }