AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ObjectWorldLoader Class Reference

Public Member Functions

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

Public Attributes

uint32i_corpses
 

Private Attributes

Cell i_cell
 
Mapi_map
 
NGridTypei_grid
 

Detailed Description

Constructor & Destructor Documentation

◆ ObjectWorldLoader()

ObjectWorldLoader::ObjectWorldLoader ( ObjectGridLoader gloader)
inlineexplicit
34 : i_cell(gloader.i_cell), i_map(gloader.i_map), i_grid(gloader.i_grid), i_corpses(gloader.i_corpses)
35 {}
uint32 & i_corpses
Definition: ObjectGridLoader.cpp:46
NGridType & i_grid
Definition: ObjectGridLoader.cpp:44
Cell i_cell
Definition: ObjectGridLoader.cpp:42
Map * i_map
Definition: ObjectGridLoader.cpp:43
Cell i_cell
Definition: ObjectGridLoader.h:46
Map * i_map
Definition: ObjectGridLoader.h:48
uint32 i_corpses
Definition: ObjectGridLoader.h:51
NGridType & i_grid
Definition: ObjectGridLoader.h:47

Member Function Documentation

◆ Visit() [1/2]

void ObjectWorldLoader::Visit ( CorpseMapType m)
164{
165 CellCoord cellCoord = i_cell.GetCellCoord();
166 if (std::unordered_set<Corpse*> const* corpses = i_map->GetCorpsesInCell(cellCoord.GetId()))
167 {
168 for (Corpse* corpse : *corpses)
169 {
170 corpse->AddToWorld();
172 if (corpse->IsWorldObject())
173 cell.AddWorldObject(corpse);
174 else
175 cell.AddGridObject(corpse);
176
177 ++i_corpses;
178 }
179 }
180}
Definition: Corpse.h:49
CellCoord GetCellCoord() const
Definition: Cell.h:76
uint32 CellX() const
Definition: Cell.h:69
uint32 CellY() const
Definition: Cell.h:70
Definition: Grid.h:46
void AddWorldObject(SPECIFIC_OBJECT *obj)
Definition: Grid.h:57
void AddGridObject(SPECIFIC_OBJECT *obj)
Definition: Grid.h:101
uint32 GetId() const
Definition: GridDefines.h:147
GridType & GetGridType(const uint32 x, const uint32 y)
Definition: NGrid.h:44
std::unordered_set< Corpse * > const * GetCorpsesInCell(uint32 cellId) const
Definition: Map.h:523

References Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::AddGridObject(), Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::AddWorldObject(), Cell::CellX(), Cell::CellY(), Cell::GetCellCoord(), Map::GetCorpsesInCell(), NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetGridType(), CoordPair< LIMIT >::GetId(), i_cell, i_corpses, i_grid, and i_map.

◆ Visit() [2/2]

template<class T >
void ObjectWorldLoader::Visit ( GridRefMgr< T > &  )
inline
39{ }

Member Data Documentation

◆ i_cell

Cell ObjectWorldLoader::i_cell
private

Referenced by Visit().

◆ i_corpses

uint32& ObjectWorldLoader::i_corpses

Referenced by Visit().

◆ i_grid

NGridType& ObjectWorldLoader::i_grid
private

Referenced by Visit().

◆ i_map

Map* ObjectWorldLoader::i_map
private

Referenced by Visit().