TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ObjectWorldLoader Class Reference

Public Member Functions

 ObjectWorldLoader (ObjectGridLoader &gloader)
 
void Visit (CorpseMapType &m)
 
template<class T >
void Visit (GridRefManager< T > &)
 

Public Attributes

uint32i_corpses
 

Private Attributes

Cell i_cell
 
Mapi_map
 
NGridTypei_grid
 

Detailed Description

Todo:
to implement npc on transport, also need to load npcs at grid loading

Constructor & Destructor Documentation

ObjectWorldLoader::ObjectWorldLoader ( ObjectGridLoader gloader)
inlineexplicit
66  : i_cell(gloader.i_cell), i_map(gloader.i_map), i_grid(gloader.i_grid), i_corpses(gloader.i_corpses)
67  { }
Map * i_map
Definition: ObjectGridLoader.cpp:75
uint32 & i_corpses
Definition: ObjectGridLoader.cpp:78
Cell i_cell
Definition: ObjectGridLoader.h:50
NGridType & i_grid
Definition: ObjectGridLoader.h:51
Map * i_map
Definition: ObjectGridLoader.h:52
Cell i_cell
Definition: ObjectGridLoader.cpp:74
NGridType & i_grid
Definition: ObjectGridLoader.cpp:76
uint32 i_corpses
Definition: ObjectGridLoader.h:55

Member Function Documentation

void ObjectWorldLoader::Visit ( CorpseMapType m)
149 {
150  CellCoord cellCoord = i_cell.GetCellCoord();
151  if (std::unordered_set<Corpse*> const* corpses = i_map->GetCorpsesInCell(cellCoord.GetId()))
152  {
153  for (Corpse* corpse : *corpses)
154  {
155  corpse->AddToWorld();
157  if (corpse->IsWorldObject())
158  cell.AddWorldObject(corpse);
159  else
160  cell.AddGridObject(corpse);
161 
162  ++i_corpses;
163  }
164  }
165 }
Definition: Corpse.h:49
Map * i_map
Definition: ObjectGridLoader.cpp:75
uint32 CellY() const
Definition: Cell.h:75
uint32 & i_corpses
Definition: ObjectGridLoader.cpp:78
Definition: Grid.h:46
GridType & GetGridType(const uint32 x, const uint32 y)
Definition: NGrid.h:86
void AddGridObject(SPECIFIC_OBJECT *obj)
Definition: Grid.h:112
uint32 CellX() const
Definition: Cell.h:74
CellCoord GetCellCoord() const
Definition: Cell.h:81
Cell i_cell
Definition: ObjectGridLoader.cpp:74
NGridType & i_grid
Definition: ObjectGridLoader.cpp:76
std::unordered_set< Corpse * > const * GetCorpsesInCell(uint32 cellId) const
Definition: Map.h:474
uint32 GetId() const
Definition: GridDefines.h:150
void AddWorldObject(SPECIFIC_OBJECT *obj)
Definition: Grid.h:59

+ Here is the call graph for this function:

template<class T >
void ObjectWorldLoader::Visit ( GridRefManager< T > &  )
inline
71 { }

Member Data Documentation

Cell ObjectWorldLoader::i_cell
private
uint32& ObjectWorldLoader::i_corpses
NGridType& ObjectWorldLoader::i_grid
private
Map* ObjectWorldLoader::i_map
private

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