예제 #1
0
void Production::save(YAML::Emitter &out)
{
	out << YAML::BeginMap;
	out << YAML::Key << "item" << YAML::Value << getRules ()->getName ();
	out << YAML::Key << "assigned" << YAML::Value << getAssignedEngineers ();
	out << YAML::Key << "spent" << YAML::Value << getTimeSpent ();
	out << YAML::Key << "amount" << YAML::Value << getAmountTotal ();
	out << YAML::EndMap;
}
예제 #2
0
YAML::Node Production::save() const
{
	YAML::Node node;
	node["item"] = getRules ()->getName ();
	node["assigned"] = getAssignedEngineers ();
	node["spent"] = getTimeSpent ();
	node["amount"] = getAmountTotal ();
	return node;
}
예제 #3
0
YAML::Node Production::save() const
{
	YAML::Node node;
	node["item"] = getRules()->getName();
	node["assigned"] = getAssignedEngineers();
	node["spent"] = getTimeSpent();
	node["amount"] = getAmountTotal();
	node["infinite"] = getInfiniteAmount();
	if (getSellItems())
		node["sell"] = getSellItems();
	return node;
}
예제 #4
0
void Production::load(const YAML::Node &node)
{
	setAssignedEngineers(node["assigned"].as<int>(getAssignedEngineers()));
	setTimeSpent(node["spent"].as<int>(getTimeSpent()));
	setAmountTotal(node["amount"].as<int>(getAmountTotal()));
	setInfiniteAmount(node["infinite"].as<bool>(getInfiniteAmount()));
	setSellItems(node["sell"].as<bool>(getSellItems()));
	// backwards compatibility
	if (getAmountTotal() == INT_MAX)
	{
		setAmountTotal(999);
		setInfiniteAmount(true);
		setSellItems(true);
	}
}