当前位置: 首页>>代码示例>>C++>>正文


C++ map_location::write方法代码示例

本文整理汇总了C++中map_location::write方法的典型用法代码示例。如果您正苦于以下问题:C++ map_location::write方法的具体用法?C++ map_location::write怎么用?C++ map_location::write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在map_location的用法示例。


在下文中一共展示了map_location::write方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_attack

config replay_helper::get_attack(const map_location& a, const map_location& b,
	int att_weapon, int def_weapon, const std::string& attacker_type_id,
	const std::string& defender_type_id, int attacker_lvl,
	int defender_lvl, const size_t turn, const time_of_day &t)
{

	config move, src, dst;
	a.write(src);
	b.write(dst);

	move.add_child("source", std::move(src));
	move.add_child("destination", std::move(dst));


	move["weapon"] = att_weapon;
	move["defender_weapon"] = def_weapon;
	move["attacker_type"] = attacker_type_id;
	move["defender_type"] = defender_type_id;
	move["attacker_lvl"] = attacker_lvl;
	move["defender_lvl"] = defender_lvl;
	move["turn"] = int(turn);
	move["tod"] = t.id;
	/*
	add_unit_checksum(a,current_);
	add_unit_checksum(b,current_);
	*/
	return move;
}
开发者ID:fluffbeast,项目名称:wesnoth-old,代码行数:28,代码来源:replay_helper.cpp

示例2: get_recruit

config replay_helper::get_recruit(const std::string& type_id, const map_location& loc, const map_location& from)
{
	config val;
	val["type"] = type_id;
	loc.write(val);
	config& leader_position = val.add_child("from");
	from.write(leader_position);

	return val;
}
开发者ID:fluffbeast,项目名称:wesnoth-old,代码行数:10,代码来源:replay_helper.cpp

示例3: get_event

config replay_helper::get_event(const std::string& name, const map_location& loc, const map_location*  last_select_loc)
{
	config ev;
	ev["raise"] = name;
	if(loc.valid()) {
		config& source = ev.add_child("source");
		loc.write(source);
	}
	if(last_select_loc != nullptr && last_select_loc->valid())
	{
		config& source = ev.add_child("last_select");
		last_select_loc->write(source);
	}
	return ev;
}
开发者ID:fluffbeast,项目名称:wesnoth-old,代码行数:15,代码来源:replay_helper.cpp


注:本文中的map_location::write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。