#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}
void AddToGrid(T *object, Cell const &cell)
Definition Map.cpp:108
CellCoord ComputeCellCoord(float x, float y)
Definition GridDefines.h:197
References Map::AddToGrid(), and Acore::ComputeCellCoord().
◆ LoadAllCellsInGrid()
void GridObjectLoader::LoadAllCellsInGrid |
( |
| ) |
|
93{
97
99 {
100 for (
Corpse* corpse : *corpses)
101 {
102 if (corpse->IsInGrid())
103 continue;
104
105 AddObjectHelper<Corpse>(
_map, corpse);
106 }
107 }
108}
#define sObjectMgr
Definition ObjectMgr.h:1650
void LoadCreatures(CellGuidSet const &guid_set, Map *map)
Definition GridObjectLoader.cpp:37
void LoadGameObjects(CellGuidSet const &guid_set, Map *map)
Definition GridObjectLoader.cpp:62
uint32 GetId() const
Definition MapGrid.h:40
std::unordered_set< Corpse * > const * GetCorpsesInGrid(uint32 gridId) const
Definition Map.h:353
uint8 GetSpawnMode() const
Definition Map.h:264
uint32 GetId() const
Definition Map.h:226
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< GRID_OBJECT_TYPES, FAR_VISIBLE_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 |
38{
40 {
43 {
44 delete obj;
45 continue;
46 }
47
48 AddObjectHelper<Creature>(map, obj);
49
51 {
53 {
54
57 }
58 }
59 }
60}
@ IDLE_MOTION_TYPE
Definition MotionMaster.h:39
@ NOTIFY_AI_RELOCATION
Definition Object.h:69
@ NOTIFY_VISIBILITY_CHANGED
Definition Object.h:70
@ 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:660
Definition GridNotifiers.h:91
static void VisitObjects(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::VisitObjects().
Referenced by LoadAllCellsInGrid().
◆ LoadGameObjects()
void GridObjectLoader::LoadGameObjects |
( |
CellGuidSet const & |
guid_set, |
|
|
Map * |
map |
|
) |
| |
|
private |
63{
65 {
67
68 if (data &&
sObjectMgr->IsGameObjectStaticTransport(data->
id))
69 {
71
72
73
75 delete transport;
76 }
77 else
78 {
80
82 {
83 delete obj;
84 continue;
85 }
86
87 AddObjectHelper<GameObject>(map, obj);
88 }
89 }
90}
Definition GameObject.h:120
virtual bool LoadFromDB(ObjectGuid::LowType guid, Map *map)
Definition GameObject.h:159
Definition Transport.h:115
bool LoadGameObjectFromDB(ObjectGuid::LowType guid, Map *map, bool addToMap=true) override
Definition Transport.cpp:693
Definition GameObjectData.h:698
uint32 id
Definition GameObjectData.h:700
References GameObjectData::id, GameObject::LoadFromDB(), StaticTransport::LoadGameObjectFromDB(), and sObjectMgr.
Referenced by LoadAllCellsInGrid().
◆ _grid
◆ _map
Map* GridObjectLoader::_map |
|
private |
The documentation for this class was generated from the following files: