Ejemplo n.º 1
0
void
Controller::Player::takePiece( Model::Piece::PieceType inPieceType )
{
	assert( hasPiece( inPieceType ) );
	auto const it = mMeepleSupply.find( inPieceType );
	--(it->second);
	meepleSupplyChanged();
}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
void Field::removePiece() {
	if (!hasPiece()){
		throw IntegrityException{"Field::removePiece no piece to remove"};
	}
	piece_ = nullptr;
}