本文整理汇总了C++中ActorSet::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorSet::erase方法的具体用法?C++ ActorSet::erase怎么用?C++ ActorSet::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorSet
的用法示例。
在下文中一共展示了ActorSet::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getApplicableTargets
ActorSet MonsterFSM::getApplicableTargets(void) const
{
ASSERT(m_Owner!=0, "Owner was NULL");
ActorSet s = m_Owner->getZone().getObjects().exclude(m_Owner->m_ID).typeFilter<Player>();
// remove actors that are dead or ghosts
ActorSet::iterator i = s.begin();
while(i != s.end())
{
ActorSet::iterator nextIterator = i;
++nextIterator;
const Player &player = dynamic_cast<const Player&>(*i->second);
if(!player.isAlive())
{
s.erase(i);
}
i = nextIterator;
}
return s;
}
示例2: exclude
ActorSet ActorSet::exclude(OBJECT_ID id) const
{
ActorSet s = *this;
ActorSet::iterator iter = s.find(id);
if(iter != s.end()) // if present
{
s.erase(iter);
}
return s;
}