AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::VisibleChangesNotifier Struct Reference

#include "GridNotifiers.h"

Public Member Functions

 VisibleChangesNotifier (WorldObject &object)
 
template<class T >
void Visit (GridRefMgr< T > &)
 
void Visit (PlayerMapType &)
 
void Visit (CreatureMapType &)
 
void Visit (DynamicObjectMapType &)
 

Public Attributes

WorldObjecti_object
 

Detailed Description

Constructor & Destructor Documentation

◆ VisibleChangesNotifier()

Acore::VisibleChangesNotifier::VisibleChangesNotifier ( WorldObject object)
inlineexplicit
67: i_object(object) {}
WorldObject & i_object
Definition: GridNotifiers.h:65

Member Function Documentation

◆ Visit() [1/4]

void VisibleChangesNotifier::Visit ( CreatureMapType m)
130{
131 for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
132 if (iter->GetSource()->HasSharedVision())
133 for (SharedVisionList::const_iterator i = iter->GetSource()->GetSharedVisionList().begin(); i != iter->GetSource()->GetSharedVisionList().end(); ++i)
134 if ((*i)->m_seer == iter->GetSource())
135 (*i)->UpdateVisibilityOf(&i_object);
136}
Definition: LinkedList.h:139
iterator begin()
Definition: GridRefMgr.h:35
iterator end()
Definition: GridRefMgr.h:36

References GridRefMgr< OBJECT >::begin(), GridRefMgr< OBJECT >::end(), and i_object.

◆ Visit() [2/4]

void VisibleChangesNotifier::Visit ( DynamicObjectMapType m)
139{
140 for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
141 if (iter->GetSource()->GetCasterGUID().IsPlayer())
142 if (Unit* caster = iter->GetSource()->GetCaster())
143 if (Player* player = caster->ToPlayer())
144 if (player->m_seer == iter->GetSource())
145 player->UpdateVisibilityOf(&i_object);
146}
Player * ToPlayer()
Definition: Object.h:201
Definition: Player.h:1081
Definition: Unit.h:630

References GridRefMgr< OBJECT >::begin(), GridRefMgr< OBJECT >::end(), i_object, and Object::ToPlayer().

◆ Visit() [3/4]

template<class T >
void Acore::VisibleChangesNotifier::Visit ( GridRefMgr< T > &  )
inline
68{}

◆ Visit() [4/4]

void VisibleChangesNotifier::Visit ( PlayerMapType m)
114{
115 for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
116 {
117 if (iter->GetSource() == &i_object)
118 continue;
119
120 iter->GetSource()->UpdateVisibilityOf(&i_object);
121
122 if (iter->GetSource()->HasSharedVision())
123 for (SharedVisionList::const_iterator i = iter->GetSource()->GetSharedVisionList().begin(); i != iter->GetSource()->GetSharedVisionList().end(); ++i)
124 if ((*i)->m_seer == iter->GetSource())
125 (*i)->UpdateVisibilityOf(&i_object);
126 }
127}

References GridRefMgr< OBJECT >::begin(), GridRefMgr< OBJECT >::end(), and i_object.

Member Data Documentation

◆ i_object

WorldObject& Acore::VisibleChangesNotifier::i_object

Referenced by Visit().