Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
        public static Move CreateNormalMove(ChessPiece piece, Position newPosition, bool takes)
        {
            var move = new NormalPieceMove(piece, newPosition, takes);

            return(new Move(move));
        }
Exemplo n.º 3
0
 public Move(NormalPieceMove normal)
 {
     NormalPieceMove = normal;
     Type            = MoveType.NormalPiece;
 }