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


C++ unit::side_id方法代码示例

本文整理汇总了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()
{
}
开发者ID:gaconkzk,项目名称:wesnoth,代码行数:12,代码来源:statistics.cpp

示例2: advance_unit

void advance_unit(const unit& u)
{
	stats& s = get_stats(u.side_id());
	s.advanced_to[u.type_id()]++;
}
开发者ID:gaconkzk,项目名称:wesnoth,代码行数:5,代码来源:statistics.cpp

示例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();
}
开发者ID:gaconkzk,项目名称:wesnoth,代码行数:6,代码来源:statistics.cpp

示例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();
}
开发者ID:gaconkzk,项目名称:wesnoth,代码行数:6,代码来源:statistics.cpp

示例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();
}
开发者ID:gaconkzk,项目名称:wesnoth,代码行数:6,代码来源:statistics.cpp

示例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();
}
开发者ID:gaconkzk,项目名称:wesnoth,代码行数:6,代码来源:statistics.cpp


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