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)
131{
132 for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
133 if (iter->GetSource()->HasSharedVision())
134 for (SharedVisionList::const_iterator i = iter->GetSource()->GetSharedVisionList().begin(); i != iter->GetSource()->GetSharedVisionList().end(); ++i)
135 if ((*i)->m_seer == iter->GetSource())
136 (*i)->UpdateVisibilityOf(&i_object);
137}
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)
140{
141 for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
142 if (iter->GetSource()->GetCasterGUID().IsPlayer())
143 if (Unit* caster = iter->GetSource()->GetCaster())
144 if (Player* player = caster->ToPlayer())
145 if (player->m_seer == iter->GetSource())
146 player->UpdateVisibilityOf(&i_object);
147}
Player * ToPlayer()
Definition: Object.h:198
Definition: Player.h:1064
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)
115{
116 for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
117 {
118 if (iter->GetSource() == &i_object)
119 continue;
120
121 iter->GetSource()->UpdateVisibilityOf(&i_object);
122
123 if (iter->GetSource()->HasSharedVision())
124 for (SharedVisionList::const_iterator i = iter->GetSource()->GetSharedVisionList().begin(); i != iter->GetSource()->GetSharedVisionList().end(); ++i)
125 if ((*i)->m_seer == iter->GetSource())
126 (*i)->UpdateVisibilityOf(&i_object);
127 }
128}

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

Member Data Documentation

◆ i_object

WorldObject& Acore::VisibleChangesNotifier::i_object

Referenced by Visit().