本文整理汇总了C++中CreatureMapType::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureMapType::begin方法的具体用法?C++ CreatureMapType::begin怎么用?C++ CreatureMapType::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreatureMapType
的用法示例。
在下文中一共展示了CreatureMapType::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
VisibleChangesNotifier::Visit(CreatureMapType &m)
{
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
if (!iter->getSource()->GetSharedVisionList().empty())
for (SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
i != iter->getSource()->GetSharedVisionList().end(); ++i)
if ((*i)->m_seer == iter->getSource())
(*i)->UpdateVisibilityOf(&i_object);
}
示例2: Visit
void AIRelocationNotifier::Visit(CreatureMapType &m)
{
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
Creature* c = iter->GetSource();
CreatureUnitRelocationWorker(c, &i_unit);
if (isCreature)
CreatureUnitRelocationWorker((Creature*)&i_unit, c);
}
}
示例3: Visit
void ObjectGridStoper::Visit(CreatureMapType &m) {
// stop any fights at grid de-activation and remove dynobjects created at cast by creatures
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) {
if (iter->getSource()->isInCombat()) {
iter->getSource()->CombatStop();
iter->getSource()->DeleteThreatList();
iter->getSource()->AI()->EnterEvadeMode(); // Calls RemoveAllAuras
}
iter->getSource()->RemoveAllDynObjects(); // Calls RemoveFromWorld, needs to be after RemoveAllAuras or we invalidate the Owner pointer of the aura
}
}
示例4:
void
ObjectGridStoper::Visit(CreatureMapType& m)
{
// stop any fights at grid de-activation and remove dynobjects created at cast by creatures
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
iter->getSource()->CombatStop();
iter->getSource()->DeleteThreatList();
iter->getSource()->RemoveAllDynObjects();
}
}
示例5: Visit
void CreatureRelocationNotifier::Visit(CreatureMapType &m) {
if (!i_creature.isAlive())
return;
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) {
Creature* c = iter->getSource();
CreatureUnitRelocationWorker(&i_creature, c);
if (!c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
CreatureUnitRelocationWorker(c, &i_creature);
}
}
示例6: BuildPacket
void
ObjectAccessor::WorldObjectChangeAccumulator::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
if (!iter->getSource()->GetSharedVisionList().empty())
{
SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it)
BuildPacket(*it);
}
}
}
示例7: Visit
void ObjectGridEvacuator::Visit(CreatureMapType &m)
{
// creature in unloading grid can have respawn point in another grid
// if it will be unloaded then it will not respawn in original grid until unload/load original grid
// move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
for (CreatureMapType::iterator iter = m.begin(); iter != m.end();)
{
Creature* c = iter->GetSource();
++iter;
ASSERT(!c->IsPet() && "ObjectGridRespawnMover must not be called for pets");
c->GetMap()->CreatureRespawnRelocation(c, true);
}
}
示例8: Visit
void AIRelocationNotifier::Visit(CreatureMapType &m)
{
bool self = isCreature && !((Creature*)(&i_unit))->IsMoveInLineOfSightStrictlyDisabled();
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
Creature* c = iter->GetSource();
// NOTIFY_VISIBILITY_CHANGED | NOTIFY_AI_RELOCATION does not guarantee that unit will do it itself (because distance is also checked), but screw it, it's not that important
if (!c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED | NOTIFY_AI_RELOCATION) && !c->IsMoveInLineOfSightStrictlyDisabled())
CreatureUnitRelocationWorker(c, &i_unit);
if (self)
CreatureUnitRelocationWorker((Creature*)&i_unit, c);
}
}
示例9: Visit
void DelayedUnitRelocation::Visit(CreatureMapType& m)
{
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
Creature* unit = iter->getSource();
CreatureRelocationNotifier relocate(*unit, i_radius);
TypeContainerVisitor<CreatureRelocationNotifier, WorldTypeMapContainer > c2world_relocation(relocate);
TypeContainerVisitor<CreatureRelocationNotifier, GridTypeMapContainer > c2grid_relocation(relocate);
cell.Visit(p, c2world_relocation, i_map, *unit, i_radius);
cell.Visit(p, c2grid_relocation, i_map, *unit, i_radius);
}
}
示例10: Visit
void ObjectGridStoper::Visit(CreatureMapType &m)
{
// stop any fights at grid de-activation and remove dynobjects/areatriggers created at cast by creatures
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
iter->GetSource()->RemoveAllDynObjects();
iter->GetSource()->RemoveAllAreaTriggers();
if (iter->GetSource()->IsInCombat())
{
iter->GetSource()->CombatStop();
iter->GetSource()->DeleteThreatList();
iter->GetSource()->AI()->EnterEvadeMode();
}
}
}
示例11: Visit
void DelayedUnitRelocation::Visit(CreatureMapType &m)
{
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
Creature * unit = iter->getSource();
if (!unit->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
continue;
CreatureRelocationNotifier relocate(*unit);
TypeContainerVisitor<CreatureRelocationNotifier, WorldTypeMapContainer > c2world_relocation(relocate);
TypeContainerVisitor<CreatureRelocationNotifier, GridTypeMapContainer > c2grid_relocation(relocate);
cell.Visit(p, c2world_relocation, i_map, *unit, i_radius);
cell.Visit(p, c2grid_relocation, i_map, *unit, i_radius);
}
}
示例12: SendPacket
void
Deliverer::Visit(CreatureMapType &m)
{
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
if (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist)
{
// Send packet to all who are sharing the creature's vision
if (!iter->getSource()->GetSharedVisionList().empty())
{
SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
for (; it != iter->getSource()->GetSharedVisionList().end(); ++it)
SendPacket(*it);
}
}
}
}
示例13: SendPacket
void
MessageDistDeliverer::Visit(CreatureMapType &m)
{
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
if (iter->getSource()->GetExactDistSq(i_source) > i_distSq)
continue;
// Send packet to all who are sharing the creature's vision
if (!iter->getSource()->GetSharedVisionList().empty())
{
SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
for (; i != iter->getSource()->GetSharedVisionList().end(); ++i)
if ((*i)->m_seer == iter->getSource())
SendPacket(*i);
}
}
}
示例14: Visit
void CreatureRelocationNotifier::Visit(CreatureMapType& m)
{
if (!i_creature.IsAlive())
return;
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
Creature* c = iter->GetSource();
//check distance to improve performance
if (!i_creature._IsWithinDist(c, i_radius, true))
continue;
CreatureUnitRelocationWorker(&i_creature, c);
if (!c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
CreatureUnitRelocationWorker(c, &i_creature);
}
}
示例15:
void
ObjectGridCleaner::Visit(CreatureMapType &m)
{
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
iter->getSource()->CleanupsBeforeDelete();
}