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
35 : i_cell(gloader.i_cell), i_map(gloader.i_map), i_grid(gloader.i_grid), i_corpses(gloader.i_corpses)
36 {}
uint32 & i_corpses
Definition: ObjectGridLoader.cpp:47
NGridType & i_grid
Definition: ObjectGridLoader.cpp:45
Cell i_cell
Definition: ObjectGridLoader.cpp:43
Map * i_map
Definition: ObjectGridLoader.cpp:44
Cell i_cell
Definition: ObjectGridLoader.h:48
Map * i_map
Definition: ObjectGridLoader.h:50
uint32 i_corpses
Definition: ObjectGridLoader.h:53
NGridType & i_grid
Definition: ObjectGridLoader.h:49

Member Function Documentation

◆ Visit() [1/2]

void ObjectWorldLoader::Visit ( CorpseMapType m)
165{
166 CellCoord cellCoord = i_cell.GetCellCoord();
167 if (std::unordered_set<Corpse*> const* corpses = i_map->GetCorpsesInCell(cellCoord.GetId()))
168 {
169 for (Corpse* corpse : *corpses)
170 {
171 corpse->AddToWorld();
173 if (corpse->IsWorldObject())
174 cell.AddWorldObject(corpse);
175 else
176 cell.AddGridObject(corpse);
177
178 ++i_corpses;
179 }
180 }
181}
Definition: Corpse.h:49
CellCoord GetCellCoord() const
Definition: Cell.h:77
uint32 CellX() const
Definition: Cell.h:70
uint32 CellY() const
Definition: Cell.h:71
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:148
GridType & GetGridType(const uint32 x, const uint32 y)
Definition: NGrid.h:45
std::unordered_set< Corpse * > const * GetCorpsesInCell(uint32 cellId) const
Definition: Map.h:525

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
40{ }

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().