TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ObjectGridLoader.cpp File Reference
#include "ObjectGridLoader.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Creature.h"
#include "GameObject.h"
#include "DynamicObject.h"
#include "Corpse.h"
#include "AreaTrigger.h"
#include "World.h"
#include "CellImpl.h"
#include "CreatureAI.h"
+ Include dependency graph for ObjectGridLoader.cpp:

Classes

class  ObjectWorldLoader
 

Functions

template<class T >
void AddObjectHelper (CellCoord &cell, GridRefManager< T > &m, uint32 &count, Map *, T *obj)
 
template<>
void AddObjectHelper (CellCoord &cell, CreatureMapType &m, uint32 &count, Map *map, Creature *obj)
 
template<class T >
void LoadHelper (CellGuidSet const &guid_set, CellCoord &cell, GridRefManager< T > &m, uint32 &count, Map *map)
 

Function Documentation

template<class T >
void AddObjectHelper ( CellCoord cell,
GridRefManager< T > &  m,
uint32 count,
Map ,
T *  obj 
)
97 {
98  obj->AddToGrid(m);
100  obj->AddToWorld();
101  ++count;
102 }
static void SetObjectCell(T *obj, CellCoord const &cellCoord)
Definition: ObjectGridLoader.cpp:81

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<>
void AddObjectHelper ( CellCoord cell,
CreatureMapType m,
uint32 count,
Map map,
Creature obj 
)
106 {
107  obj->AddToGrid(m);
109  obj->AddToWorld();
110  if (obj->isActiveObject())
111  map->AddToActive(obj);
112 
113  ++count;
114 }
void AddToWorld() override
Definition: Creature.cpp:218
static void SetObjectCell(T *obj, CellCoord const &cellCoord)
Definition: ObjectGridLoader.cpp:81
bool isActiveObject() const
Definition: Object.h:581
void AddToGrid(GridRefManager< T > &m)
Definition: Object.h:361
void AddToActive(T *obj)
Definition: Map.cpp:2958

+ Here is the call graph for this function:

template<class T >
void LoadHelper ( CellGuidSet const guid_set,
CellCoord cell,
GridRefManager< T > &  m,
uint32 count,
Map map 
)
118 {
119  for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
120  {
121  T* obj = new T;
122  ObjectGuid::LowType guid = *i_guid;
123  //TC_LOG_INFO("misc", "DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid);
124  if (!obj->LoadFromDB(guid, map))
125  {
126  delete obj;
127  continue;
128  }
129 
130  AddObjectHelper(cell, m, count, map, obj);
131  }
132 }
uint64 LowType
Definition: ObjectGuid.h:199
void AddObjectHelper(CellCoord &cell, GridRefManager< T > &m, uint32 &count, Map *, T *obj)
Definition: ObjectGridLoader.cpp:96

+ Here is the call graph for this function:

+ Here is the caller graph for this function: