public PieceCollection getUnpickedPieces() { PieceCollection unassigned = new PieceCollection(); foreach (Piece p in pieces) { if (!p.picked) { unassigned.addPiece(p); } } return(unassigned); }
public DominoSet() { pieces = new PieceCollection(); int pieceId = 0; //Create the pieces for (int upperValue = 0; upperValue < 7; upperValue++) { for (int lowerValue = upperValue; lowerValue < 7; lowerValue++) { pieces.addPiece(new Piece(upperValue, lowerValue, pieceId)); pieceId++; } } }
public void addPiece(Piece p) { playerPieces.addPiece(p); }