Exemple #1
0
        public override string ToString()
        {
            var str = string.Empty;

            var c = char.ToUpper(MovedPiece.GetFenChar());

            if (c != 'P')
            {
                str += c;
            }

            var nX = NewField.X;
            var nY = NewField.Y;
            var oX = OldField.X;

            str += c.Load(nX);
            str += (nY + 1);

            if (Mate)
            {
                str += "#";
                return(str);
            }

            if (Check)
            {
                str += "+";
                return(str);
            }

            return(str);
        }
Exemple #2
0
        protected string GetPieceNotation()
        {
            var startingFile = MoveUtilities.GetFileFromInt(StartingSquare.Coordinate.File);

            return(MovedPiece is Pawn && IsCapture
                ? startingFile
                : MovedPiece.GetNotation());
        }
Exemple #3
0
 private string GetPromotionNotation()
 {
     return("=" + MovedPiece.GetNotation());
 }
Exemple #4
0
 protected virtual void OnMovePlayed()
 {
     MovedPiece.OnPieceMoved(EndingSquare);
     CapturedPiece?.OnPieceCaptured();
 }