Пример #1
0
Rules::Rules(std::shared_ptr<const Rulebook> rulebook) :
	rulebook(rulebook), rules(),
	gameOpts()
{
	if (rulebook) {
		rules = rulebook->CreateDefaultRules();
		rulebook->Load();
	}
}
Пример #2
0
/**
 * Set the rulebook and reset the rules to their defaults.
 * @param rulebook The rulebook (may be @c nullptr).
 */
void Rules::SetRulebook(std::shared_ptr<const Rulebook> rulebook)
{
	rules = rulebook ? rulebook->CreateDefaultRules() : luabind::object();
	this->rulebook = std::move(rulebook);
}