本文整理汇总了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;
}
示例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;
}
示例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;
}