Example #1
0
        public void MovePiece(ChessPiece piece, string algebraicPosition)
        {
            byte rowIndex = ChessPGN.UNKNOWN_INDEX;
            byte colIndex = ChessPGN.UNKNOWN_INDEX;

            ChessPGN.AlgebraicPositionToIndexes(algebraicPosition, ref rowIndex, ref colIndex);
            MovePiece(piece, rowIndex, colIndex);
        }
Example #2
0
 /// <summary>
 /// When we Refers to cells by an algebraic position, the indexes are 1-based
 /// </summary>
 /// <param name="algebraicPosition"></param>
 /// <returns></returns>
 public ChessBoardCell this[string algebraicPosition]
 {
     get
     {
         byte row    = 0;
         byte column = 0;
         ChessPGN.AlgebraicPositionToIndexes(algebraicPosition, ref row, ref column);
         if (row != ChessPGN.UNKNOWN_INDEX && column != ChessPGN.UNKNOWN_INDEX)
         {
             return(boardCells[row, column]);
         }
         else
         {
             return(null);
         }
     }
 }
Example #3
0
        public void MovePiece(string pgnMove)
        {
            ChessMove move = ChessPGN.GetMoveFromPGN(pgnMove, this, Game.Board);

            RequestMovement(move);
        }
Example #4
0
 public static ChessMove CreateStandardChessMove(string PGNNotationMove, ChessPlayer player, ChessBoard board)
 {
     return(ChessPGN.GetMoveFromPGN(PGNNotationMove, player, board));
 }
Example #5
0
 public override string ToString()
 {
     return(string.Format("{0}", ChessPGN.GetPGNNameForPiece(PieceType, false)));
 }