src/Engine/Models/ChessGame.cs
/// <summary>
/// Clears the board and all game state.
/// </summary>
Clears the board and all game state.
Clears the board and all game state .
public void ClearGameState()
        {
            Moves = new List<Move>();
            WhitePlayer = "White Player";
            BlackPlayer = "Black Player";
            Round = "-";
            StartDate = DateTimeOffset.Now;
            WhiteToMove = true;
            WhiteCastlingOptions =
                BlackCastlingOptions = CastlingOptions.KingSide | CastlingOptions.QueenSide;
            EnPassantTarget = null;
            Result = GameResult.Ongoing;
            HalfMoveClock = 0;
            MoveCount = 1;
            Check = false;
            boardState = new ChessPiece[BoardSize][];
            for (var i = 0; i < boardState.GetLength(0); i++)
            {
                boardState[i] = new ChessPiece?[BoardSize];
            }
        }
public void ClearGameState ( ) { Moves = new List < Move > ( ) ; WhitePlayer = " " ; BlackPlayer = " " ; Round = " " ; StartDate = DateTimeOffset . Now ; WhiteToMove = true ; WhiteCastlingOptions = BlackCastlingOptions = CastlingOptions . KingSide | CastlingOptions . QueenSide ; EnPassantTarget = null ; Result = GameResult . Ongoing ; HalfMoveClock = 0 ; MoveCount = 1 ; Check = false ; boardState = new ChessPiece [ BoardSize ] [ ] ; for ( var i = 0 ; i < boardState . GetLength ( 0 ) ; i ++ ) { boardState [ i ] = new ChessPiece ? [ BoardSize ] ; } }
Clears the board and all game state.
Clears the board and all game state .