//Copy Constructor internal Board(Board board) { Squares = new Square[64]; for (byte x = 0; x < 64; x++) { if (board.Squares[x].Piece != null) { Squares[x] = new Square(board.Squares[x].Piece); } } EndGamePhase = board.EndGamePhase; FiftyMove = board.FiftyMove; RepeatedMove = board.RepeatedMove; WhiteCastled = board.WhiteCastled; BlackCastled = board.BlackCastled; BlackCheck = board.BlackCheck; WhiteCheck = board.WhiteCheck; StaleMate = board.StaleMate; WhiteMate = board.WhiteMate; BlackMate = board.BlackMate; WhoseMove = board.WhoseMove; EnPassantPosition = board.EnPassantPosition; EnPassantColor = board.EnPassantColor; ZobristHash = board.ZobristHash; Score = board.Score; LastMove = new MoveContent(board.LastMove); MoveCount = board.MoveCount; }
internal Board() { Squares = new Square[64]; for (byte i = 0; i < 64; i++) { Squares[i] = new Square(); } LastMove = new MoveContent(); }