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); }
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); }
public void PutNewPiece(char column, int line, Piece piece) { Board.PutPiece(piece, new PositionChess(column, line).ToPosition()); Pieces.Add(piece); }