#include "GridObjectLoader.h"
◆ GridObjectLoader()
Map * _map
Definition GridObjectLoader.h:42
MapGridType & _grid
Definition GridObjectLoader.h:41
◆ AddObjectHelper()
template<class T >
void GridObjectLoader::AddObjectHelper |
( |
Map * |
map, |
|
|
T * |
obj |
|
) |
| |
|
private |
29{
32
34 obj->AddToWorld();
35 if (obj->isActiveObject())
37}
void AddToGrid(T *object, Cell const &cell)
Definition Map.cpp:117
void AddToActive(T *obj)
Definition Map.cpp:1828
CellCoord ComputeCellCoord(float x, float y)
Definition GridDefines.h:193
References Map::AddToActive(), Map::AddToGrid(), and Acore::ComputeCellCoord().
◆ LoadAllCellsInGrid()
void GridObjectLoader::LoadAllCellsInGrid |
( |
| ) |
|
82{
86
88 {
89 for (
Corpse* corpse : *corpses)
90 {
91 if (corpse->IsInGrid())
92 continue;
93
94 AddObjectHelper<Corpse>(
_map, corpse);
95 }
96 }
97}
#define sObjectMgr
Definition ObjectMgr.h:1650
void LoadCreatures(CellGuidSet const &guid_set, Map *map)
Definition GridObjectLoader.cpp:39
void LoadGameObjects(CellGuidSet const &guid_set, Map *map)
Definition GridObjectLoader.cpp:64
uint32 GetId() const
Definition MapGrid.h:40
std::unordered_set< Corpse * > const * GetCorpsesInGrid(uint32 gridId) const
Definition Map.h:362
uint8 GetSpawnMode() const
Definition Map.h:262
uint32 GetId() const
Definition Map.h:224
Definition ObjectMgr.h:478
CellGuidSet gameobjects
Definition ObjectMgr.h:480
CellGuidSet creatures
Definition ObjectMgr.h:479
References _grid, _map, CellObjectGuids::creatures, CellObjectGuids::gameobjects, Map::GetCorpsesInGrid(), MapGrid< WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetId(), Map::GetId(), Map::GetSpawnMode(), LoadCreatures(), LoadGameObjects(), and sObjectMgr.
Referenced by MapGridManager::LoadGrid().
◆ LoadCreatures()
void GridObjectLoader::LoadCreatures |
( |
CellGuidSet const & |
guid_set, |
|
|
Map * |
map |
|
) |
| |
|
private |
40{
42 {
45 {
46 delete obj;
47 continue;
48 }
49
50 AddObjectHelper<Creature>(map, obj);
51
53 {
55 {
56
59 }
60 }
61 }
62}
@ IDLE_MOTION_TYPE
Definition MotionMaster.h:39
@ NOTIFY_AI_RELOCATION
Definition Object.h:68
@ NOTIFY_VISIBILITY_CHANGED
Definition Object.h:69
@ UNIT_STATE_SIGHTLESS
Definition UnitDefines.h:213
@ REACT_AGGRESSIVE
Definition Unit.h:551
bool HasReactState(ReactStates state) const
Definition Creature.h:97
bool IsMoveInLineOfSightDisabled()
Definition Creature.h:280
MovementGeneratorType GetDefaultMovementType() const override
-------—End of Pet responses methods-------—
Definition Creature.h:86
bool LoadFromDB(ObjectGuid::LowType guid, Map *map, bool allowDuplicate=false)
Definition Creature.h:223
uint32 LowType
Definition ObjectGuid.h:122
bool IsAlive() const
Definition Unit.h:1707
bool IsImmuneToNPC() const
Definition Unit.h:874
bool HasUnitState(const uint32 f) const
Definition Unit.h:691
bool isNeedNotify(uint16 f) const
Definition Object.h:627
Definition GridNotifiers.h:91
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165
References Creature::GetDefaultMovementType(), Creature::HasReactState(), Unit::HasUnitState(), IDLE_MOTION_TYPE, Unit::IsAlive(), Unit::IsImmuneToNPC(), Creature::IsMoveInLineOfSightDisabled(), WorldObject::isNeedNotify(), Creature::LoadFromDB(), NOTIFY_AI_RELOCATION, NOTIFY_VISIBILITY_CHANGED, REACT_AGGRESSIVE, UNIT_STATE_SIGHTLESS, and Cell::VisitGridObjects().
Referenced by LoadAllCellsInGrid().
◆ LoadGameObjects()
void GridObjectLoader::LoadGameObjects |
( |
CellGuidSet const & |
guid_set, |
|
|
Map * |
map |
|
) |
| |
|
private |
65{
67 {
70
72 {
73 delete obj;
74 continue;
75 }
76
77 AddObjectHelper<GameObject>(map, obj);
78 }
79}
Definition GameObject.h:120
bool LoadFromDB(ObjectGuid::LowType guid, Map *map)
Definition GameObject.h:159
Definition Transport.h:113
Definition GameObjectData.h:696
uint32 id
Definition GameObjectData.h:698
References GameObjectData::id, GameObject::LoadFromDB(), and sObjectMgr.
Referenced by LoadAllCellsInGrid().
◆ _grid
◆ _map
Map* GridObjectLoader::_map |
|
private |
The documentation for this class was generated from the following files: