Пример #1
0
        public void UndoesMovement(Position origin, Position destination, Piece pieceCaptured)
        {
            Piece p = Board.RemovePiece(destination);

            p.RemoveQtyMovements();
            if (pieceCaptured != null)
            {
                Board.PutPiece(pieceCaptured, destination);
                Captured.Remove(pieceCaptured);
            }
            Board.PutPiece(p, origin);
        }
Пример #2
0
        public Piece RunMotion(Position origin, Position destination)
        {
            Piece p = Board.RemovePiece(origin);

            p.AddQtyMovements();
            Piece pieceCaptured = Board.RemovePiece(destination);

            Board.PutPiece(p, destination);
            if (pieceCaptured != null)
            {
                Captured.Add(pieceCaptured);
            }
            return(pieceCaptured);
        }
Пример #3
0
 public void PutNewPiece(char column, int line, Piece piece)
 {
     Board.PutPiece(piece, new PositionChess(column, line).ToPosition());
     Pieces.Add(piece);
 }