private CastlingState GetCastlingStateForRookMovement(Piece piece, Move move, CastlingState currentState)
        {
            var newCastlingState = new CastlingState
            {
                WhiteKingside  = currentState.WhiteKingside,
                WhiteQueenside = currentState.WhiteQueenside,
                BlackKingside  = currentState.BlackKingside,
                BlackQueenside = currentState.BlackQueenside
            };

            if (piece.Color == Color.White)
            {
                if (move.StartPosition.X == 0 && move.StartPosition.Y == 0)
                {
                    newCastlingState.WhiteQueenside = false;
                }
                else if (move.StartPosition.X == 7 && move.StartPosition.Y == 0)
                {
                    newCastlingState.WhiteKingside = false;
                }

                return(newCastlingState);
            }

            if (move.StartPosition.X == 0 && move.StartPosition.Y == 7)
            {
                newCastlingState.BlackQueenside = false;
            }
            else if (move.StartPosition.X == 7 && move.StartPosition.Y == 7)
            {
                newCastlingState.BlackKingside = false;
            }

            return(newCastlingState);
        }
        private string GetCastlingStateFen(CastlingState state)
        {
            if (!state.WhiteKingside && !state.WhiteQueenside && !state.BlackKingside && !state.BlackQueenside)
            {
                return("-");
            }

            string output = "";

            if (state.WhiteKingside)
            {
                output += 'K';
            }

            if (state.WhiteQueenside)
            {
                output += 'Q';
            }

            if (state.BlackKingside)
            {
                output += 'k';
            }

            if (state.BlackQueenside)
            {
                output += 'q';
            }

            return(output);
        }
        private CastlingState GetCastlingStateForKingMovement(Piece piece, CastlingState currentState)
        {
            if (piece.Color == Color.White)
            {
                return(new CastlingState
                {
                    WhiteKingside = false,
                    WhiteQueenside = false,
                    BlackKingside = currentState.BlackKingside,
                    BlackQueenside = currentState.BlackQueenside
                });
            }

            return(new CastlingState
            {
                WhiteKingside = currentState.WhiteKingside,
                WhiteQueenside = currentState.WhiteQueenside,
                BlackKingside = false,
                BlackQueenside = false
            });
        }