예제 #1
0
        public override string ToString()
        {
            switch (Type)
            {
            case MoveType.Castle:
                return(Castle.ToString());

            case MoveType.EnPassant:
                return(EnPassant.ToString());

            case MoveType.NormalPiece:
                return(NormalPieceMove.ToString());

            case MoveType.Promotion:
                return(Promotion.ToString());

            default:
                throw new AlienChessException();
            }
        }
예제 #2
0
        public static Move CreateNormalMove(ChessPiece piece, Position newPosition, bool takes)
        {
            var move = new NormalPieceMove(piece, newPosition, takes);

            return(new Move(move));
        }
예제 #3
0
 public Move(NormalPieceMove normal)
 {
     NormalPieceMove = normal;
     Type            = MoveType.NormalPiece;
 }