TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldObjectChangeAccumulator Struct Reference

Public Member Functions

 WorldObjectChangeAccumulator (WorldObject &obj, UpdateDataMapType &d)
 
void Visit (PlayerMapType &m)
 
void Visit (CreatureMapType &m)
 
void Visit (DynamicObjectMapType &m)
 
void BuildPacket (Player *player)
 
template<class SKIP >
void Visit (GridRefManager< SKIP > &)
 

Public Attributes

UpdateDataMapTypei_updateDatas
 
WorldObjecti_object
 
GuidSet plr_list
 

Constructor & Destructor Documentation

WorldObjectChangeAccumulator::WorldObjectChangeAccumulator ( WorldObject obj,
UpdateDataMapType d 
)
inline
3013 : i_updateDatas(d), i_object(obj) { }
WorldObject & i_object
Definition: Object.cpp:3011
UpdateDataMapType & i_updateDatas
Definition: Object.cpp:3010

Member Function Documentation

void WorldObjectChangeAccumulator::BuildPacket ( Player player)
inline
3066  {
3067  // Only send update once to a player
3068  if (plr_list.find(player->GetGUID()) == plr_list.end() && player->HaveAtClient(&i_object))
3069  {
3071  plr_list.insert(player->GetGUID());
3072  }
3073  }
GuidSet plr_list
Definition: Object.cpp:3012
void BuildFieldsUpdate(Player *, UpdateDataMapType &) const
Definition: Object.cpp:844
WorldObject & i_object
Definition: Object.cpp:3011
UpdateDataMapType & i_updateDatas
Definition: Object.cpp:3010

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldObjectChangeAccumulator::Visit ( PlayerMapType m)
inline
3015  {
3016  Player* source = NULL;
3017  for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
3018  {
3019  source = iter->GetSource();
3020 
3021  BuildPacket(source);
3022 
3023  if (!source->GetSharedVisionList().empty())
3024  {
3025  SharedVisionList::const_iterator it = source->GetSharedVisionList().begin();
3026  for (; it != source->GetSharedVisionList().end(); ++it)
3027  BuildPacket(*it);
3028  }
3029  }
3030  }
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
void BuildPacket(Player *player)
Definition: Object.cpp:3065
iterator end()
Definition: GridRefManager.h:37

+ Here is the call graph for this function:

void WorldObjectChangeAccumulator::Visit ( CreatureMapType m)
inline
3033  {
3034  Creature* source = NULL;
3035  for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
3036  {
3037  source = iter->GetSource();
3038  if (!source->GetSharedVisionList().empty())
3039  {
3040  SharedVisionList::const_iterator it = source->GetSharedVisionList().begin();
3041  for (; it != source->GetSharedVisionList().end(); ++it)
3042  BuildPacket(*it);
3043  }
3044  }
3045  }
SharedVisionList const & GetSharedVisionList()
Definition: Unit.h:1754
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Creature.h:467
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
void BuildPacket(Player *player)
Definition: Object.cpp:3065
iterator end()
Definition: GridRefManager.h:37

+ Here is the call graph for this function:

void WorldObjectChangeAccumulator::Visit ( DynamicObjectMapType m)
inline
3048  {
3049  DynamicObject* source = NULL;
3050  for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
3051  {
3052  source = iter->GetSource();
3053  ObjectGuid guid = source->GetCasterGUID();
3054 
3055  if (guid.IsPlayer())
3056  {
3057  //Caster may be NULL if DynObj is in removelist
3058  if (Player* caster = ObjectAccessor::FindPlayer(guid))
3059  if (caster->GetGuidValue(PLAYER_FARSIGHT) == source->GetGUID())
3060  BuildPacket(caster);
3061  }
3062  }
3063  }
bool IsPlayer() const
Definition: ObjectGuid.h:249
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: DynamicObject.h:35
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:209
Definition: LinkedList.h:141
ObjectGuid GetCasterGUID() const
Definition: DynamicObject.h:58
iterator begin()
Definition: GridRefManager.h:36
ObjectGuid const & GetGUID() const
Definition: Object.h:105
void BuildPacket(Player *player)
Definition: Object.cpp:3065
Definition: ObjectGuid.h:189
iterator end()
Definition: GridRefManager.h:37
Definition: UpdateFields.h:212

+ Here is the call graph for this function:

template<class SKIP >
void WorldObjectChangeAccumulator::Visit ( GridRefManager< SKIP > &  )
inline
3075 { }

Member Data Documentation

WorldObject& WorldObjectChangeAccumulator::i_object
UpdateDataMapType& WorldObjectChangeAccumulator::i_updateDatas
GuidSet WorldObjectChangeAccumulator::plr_list

The documentation for this struct was generated from the following file: