本文整理汇总了C++中PlayerState::get_owned_properties方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerState::get_owned_properties方法的具体用法?C++ PlayerState::get_owned_properties怎么用?C++ PlayerState::get_owned_properties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerState
的用法示例。
在下文中一共展示了PlayerState::get_owned_properties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: release_assets
bool GameRules::release_assets(const PlayerState& plr)
{
const net::PropertyList_t& p_list = plr.get_owned_properties();
net::PropertyList_t::const_iterator it;
// iterate through the list freeing assets
for (it = p_list.begin(); it != p_list.end(); ++it)
{
// set the property to unowned
fState->get_property(*it).set_unowned();
// set the property level to zero
// TODO is this necessary?
fState->get_property(*it).set_level(0);
}
return true;
}
示例2: count_mems
unsigned GameRules::count_mems(const PlayerState& plr, unsigned id)
{
vector<unsigned> vec;
unsigned mems = fBase.group_members(id, vec);
unsigned cnt = 0;
const net::PropertyList_t props = plr.get_owned_properties();
net::PropertyList_t::const_iterator it;
for (unsigned i = 0; i < mems; ++i)
{
for (it = props.begin(); it != props.end(); ++it)
if (vec[i] == *it)
{
++cnt;
break;
}
}
return cnt;
}