本文整理汇总了C++中unit::side_id方法的典型用法代码示例。如果您正苦于以下问题:C++ unit::side_id方法的具体用法?C++ unit::side_id怎么用?C++ unit::side_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unit
的用法示例。
在下文中一共展示了unit::side_id方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
attack_context::attack_context(const unit& a,
const unit& d, int a_cth, int d_cth) :
attacker_type(a.type_id()),
defender_type(d.type_id()),
attacker_side(a.side_id()),
defender_side(d.side_id()),
chance_to_hit_defender(a_cth),
chance_to_hit_attacker(d_cth),
attacker_res(),
defender_res()
{
}
示例2: advance_unit
void advance_unit(const unit& u)
{
stats& s = get_stats(u.side_id());
s.advanced_to[u.type_id()]++;
}
示例3: un_recall_unit_cost
int un_recall_unit_cost(const unit& u) // this really belongs elsewhere, perhaps in undo.cpp
{ // but I'm too lazy to do it at the moment
stats& s = get_stats(u.side_id());
s.recalls[u.type_id()]--;
return u.recall_cost();
}
示例4: un_recruit_unit
void un_recruit_unit(const unit& u)
{
stats& s = get_stats(u.side_id());
s.recruits[u.type().base_id()]--;
s.recruit_cost -= u.cost();
}
示例5: un_recall_unit
void un_recall_unit(const unit& u)
{
stats& s = get_stats(u.side_id());
s.recalls[u.type_id()]--;
s.recall_cost -= u.cost();
}
示例6: recall_unit
void recall_unit(const unit& u)
{
stats& s = get_stats(u.side_id());
s.recalls[u.type_id()]++;
s.recall_cost += u.cost();
}