void Controller::Player::takePiece( Model::Piece::PieceType inPieceType ) { assert( hasPiece( inPieceType ) ); auto const it = mMeepleSupply.find( inPieceType ); --(it->second); meepleSupplyChanged(); }
void Field::setPiece(const Piece &piece) { if (hasPiece()) { throw IntegrityException{"Field::setPiece field already set"}; } if (piece.getPosition() != getPosition()) { throw IntegrityException("FIeld::setPiece invalid piece position"); } piece_ = &piece; }
void Field::removePiece() { if (!hasPiece()){ throw IntegrityException{"Field::removePiece no piece to remove"}; } piece_ = nullptr; }