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

#include <GarrisonMap.h>

Public Member Functions

 GarrisonMap (uint32 id, time_t, uint32 instanceId, Map *parent, ObjectGuid const &owner)
 
void LoadGridObjects (NGridType *grid, Cell const &cell) override
 
GarrisonGetGarrison ()
 
void InitVisibilityDistance () override
 
bool AddPlayerToMap (Player *player, bool initPlayer=true) override
 
- Public Member Functions inherited from Map
 Map (uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode, Map *_parent=NULL)
 
virtual ~Map ()
 
MapEntry constGetEntry () const
 
bool CanUnload (uint32 diff)
 
virtual void RemovePlayerFromMap (Player *, bool)
 
template<class T >
bool AddToMap (T *)
 
template<class T >
void RemoveFromMap (T *, bool)
 
void VisitNearbyCellsOf (WorldObject *obj, TypeContainerVisitor< Trinity::ObjectUpdater, GridTypeMapContainer > &gridVisitor, TypeContainerVisitor< Trinity::ObjectUpdater, WorldTypeMapContainer > &worldVisitor)
 
virtual void Update (const uint32)
 
float GetVisibilityRange () const
 
void PlayerRelocation (Player *, float x, float y, float z, float orientation)
 
void CreatureRelocation (Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail=true)
 
void GameObjectRelocation (GameObject *go, float x, float y, float z, float orientation, bool respawnRelocationOnFail=true)
 
void DynamicObjectRelocation (DynamicObject *go, float x, float y, float z, float orientation)
 
template<class T , class CONTAINER >
void Visit (const Cell &cell, TypeContainerVisitor< T, CONTAINER > &visitor)
 
bool IsRemovalGrid (float x, float y) const
 
bool IsGridLoaded (float x, float y) const
 
bool GetUnloadLock (const GridCoord &p) const
 
void SetUnloadLock (const GridCoord &p, bool on)
 
void LoadGrid (float x, float y)
 
bool UnloadGrid (NGridType &ngrid, bool pForce)
 
virtual void UnloadAll ()
 
void ResetGridExpiry (NGridType &grid, float factor=1) const
 
time_t GetGridExpiry (void) const
 
uint32 GetId (void) const
 
Map constGetParent () const
 
float GetHeight (float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
float GetMinHeight (float x, float y) const
 
ZLiquidStatus getLiquidStatus (float x, float y, float z, uint8 ReqLiquidType, LiquidData *data=nullptr) const
 
uint32 GetAreaId (float x, float y, float z, bool *isOutdoors) const
 
bool GetAreaInfo (float x, float y, float z, uint32 &mogpflags, int32 &adtId, int32 &rootId, int32 &groupId) const
 
uint32 GetAreaId (float x, float y, float z) const
 
uint32 GetZoneId (float x, float y, float z) const
 
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid, float x, float y, float z) const
 
bool IsOutdoors (float x, float y, float z) const
 
uint8 GetTerrainType (float x, float y) const
 
float GetWaterLevel (float x, float y) const
 
bool IsInWater (float x, float y, float z, LiquidData *data=nullptr) const
 
bool IsUnderWater (float x, float y, float z) const
 
void MoveAllCreaturesInMoveList ()
 
void MoveAllGameObjectsInMoveList ()
 
void MoveAllDynamicObjectsInMoveList ()
 
void RemoveAllObjectsInRemoveList ()
 
virtual void RemoveAllPlayers ()
 
bool CreatureRespawnRelocation (Creature *c, bool diffGridOnly)
 
bool GameObjectRespawnRelocation (GameObject *go, bool diffGridOnly)
 
bool CheckGridIntegrity (Creature *c, bool moved) const
 
uint32 GetInstanceId () const
 
uint8 GetSpawnMode () const
 
virtual EnterState CannotEnter (Player *)
 
const char * GetMapName () const
 
Difficulty GetDifficultyID () const
 
MapDifficultyEntry constGetMapDifficulty () const
 
uint32 GetDifficultyLootBonusTreeMod () const
 
bool Instanceable () const
 
bool IsDungeon () const
 
bool IsNonRaidDungeon () const
 
bool IsRaid () const
 
bool IsRaidOrHeroicDungeon () const
 
bool IsHeroic () const
 
bool Is25ManRaid () const
 
bool IsBattleground () const
 
bool IsBattleArena () const
 
bool IsBattlegroundOrArena () const
 
bool IsGarrison () const
 
bool GetEntrancePos (int32 &mapid, float &x, float &y)
 
void AddObjectToRemoveList (WorldObject *obj)
 
void AddObjectToSwitchList (WorldObject *obj, bool on)
 
virtual void DelayedUpdate (const uint32 diff)
 
void UpdateObjectVisibility (WorldObject *obj, Cell cell, CellCoord cellpair)
 
void UpdateObjectsVisibilityFor (Player *player, Cell cell, CellCoord cellpair)
 
void resetMarkedCells ()
 
bool isCellMarked (uint32 pCellId)
 
void markCell (uint32 pCellId)
 
bool HavePlayers () const
 
uint32 GetPlayersCountExceptGMs () const
 
bool ActiveObjectsNearGrid (NGridType const &ngrid) const
 
void AddWorldObject (WorldObject *obj)
 
void RemoveWorldObject (WorldObject *obj)
 
void SendToPlayers (WorldPacket const *data) const
 
PlayerList constGetPlayers () const
 
void ScriptsStart (std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
 Put scripts in the execution queue. More...
 
void ScriptCommandStart (ScriptInfo const &script, uint32 delay, Object *source, Object *target)
 
template<class T >
void AddToActive (T *obj)
 
template<class T >
void RemoveFromActive (T *obj)
 
template<class T >
void SwitchGridContainers (T *obj, bool on)
 
template<class NOTIFIER >
void VisitAll (const float &x, const float &y, float radius, NOTIFIER &notifier)
 
template<class NOTIFIER >
void VisitFirstFound (const float &x, const float &y, float radius, NOTIFIER &notifier)
 
template<class NOTIFIER >
void VisitWorld (const float &x, const float &y, float radius, NOTIFIER &notifier)
 
template<class NOTIFIER >
void VisitGrid (const float &x, const float &y, float radius, NOTIFIER &notifier)
 
void UpdateIteratorBack (Player *player)
 
TempSummonSummonCreature (uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=NULL, uint32 duration=0, Unit *summoner=NULL, uint32 spellId=0, uint32 vehId=0)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=NULL)
 
AreaTriggerGetAreaTrigger (ObjectGuid const &guid)
 
CorpseGetCorpse (ObjectGuid const &guid)
 
CreatureGetCreature (ObjectGuid const &guid)
 
DynamicObjectGetDynamicObject (ObjectGuid const &guid)
 
GameObjectGetGameObject (ObjectGuid const &guid)
 
PetGetPet (ObjectGuid const &guid)
 
TransportGetTransport (ObjectGuid const &guid)
 
MapStoredObjectTypesContainerGetObjectsStore ()
 
CreatureBySpawnIdContainerGetCreatureBySpawnIdStore ()
 
GameObjectBySpawnIdContainerGetGameObjectBySpawnIdStore ()
 
std::unordered_set< Corpse * >
const
GetCorpsesInCell (uint32 cellId) const
 
CorpseGetCorpseByPlayer (ObjectGuid const &ownerGuid) const
 
MapInstancedToMapInstanced ()
 
MapInstanced constToMapInstanced () const
 
InstanceMapToInstanceMap ()
 
InstanceMap constToInstanceMap () const
 
BattlegroundMapToBattlegroundMap ()
 
BattlegroundMap constToBattlegroundMap () const
 
float GetWaterOrGroundLevel (float x, float y, float z, float *ground=NULL, bool swim=false) const
 
float GetHeight (uint32 phasemask, float x, float y, float z, bool vmap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
bool isInLineOfSight (float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const
 
void Balance ()
 
void RemoveGameObjectModel (const GameObjectModel &model)
 
void InsertGameObjectModel (const GameObjectModel &model)
 
bool ContainsGameObjectModel (const GameObjectModel &model) const
 
bool getObjectHitPos (uint32 phasemask, float x1, float y1, float z1, float x2, float y2, float z2, float &rx, float &ry, float &rz, float modifyDist)
 
virtual ObjectGuid::LowType GetOwnerGuildId (uint32=TEAM_OTHER) const
 
time_t GetLinkedRespawnTime (ObjectGuid guid) const
 
time_t GetCreatureRespawnTime (ObjectGuid::LowType dbGuid) const
 
time_t GetGORespawnTime (ObjectGuid::LowType dbGuid) const
 
void SaveCreatureRespawnTime (ObjectGuid::LowType dbGuid, time_t respawnTime)
 
void RemoveCreatureRespawnTime (ObjectGuid::LowType dbGuid)
 
void SaveGORespawnTime (ObjectGuid::LowType dbGuid, time_t respawnTime)
 
void RemoveGORespawnTime (ObjectGuid::LowType dbGuid)
 
void LoadRespawnTimes ()
 
void DeleteRespawnTimes ()
 
void LoadCorpseData ()
 
void DeleteCorpseData ()
 
void AddCorpse (Corpse *corpse)
 
void RemoveCorpse (Corpse *corpse)
 
CorpseConvertCorpseToBones (ObjectGuid const &ownerGuid, bool insignia=false)
 
void RemoveOldCorpses ()
 
void SendInitTransports (Player *player)
 
void SendRemoveTransports (Player *player)
 
void SendUpdateTransportVisibility (Player *player, std::set< uint32 > const &previousPhases)
 
void SendZoneDynamicInfo (Player *player)
 
void SetZoneMusic (uint32 zoneId, uint32 musicId)
 
void SetZoneWeather (uint32 zoneId, WeatherState weatherId, float weatherGrade)
 
void SetZoneOverrideLight (uint32 zoneId, uint32 lightId, uint32 fadeInTime)
 
void UpdateAreaDependentAuras ()
 
template<HighGuid high>
ObjectGuid::LowType GenerateLowGuid ()
 
void AddUpdateObject (Object *obj)
 
void RemoveUpdateObject (Object *obj)
 
template<>
void AddToGrid (Creature *obj, Cell const &cell)
 
template<>
void AddToGrid (GameObject *obj, Cell const &cell)
 
template<>
void AddToGrid (DynamicObject *obj, Cell const &cell)
 
template<>
void AddToGrid (Corpse *obj, Cell const &cell)
 
template<>
void SwitchGridContainers (Creature *obj, bool on)
 
template<>
void SwitchGridContainers (GameObject *obj, bool on)
 
template<>
void DeleteFromWorld (Player *player)
 
template<>
void DeleteFromWorld (Transport *transport)
 
template<>
void InitializeObject (Creature *obj)
 
template<>
void InitializeObject (GameObject *obj)
 
template<>
bool AddToMap (Transport *obj)
 
template<>
void RemoveFromMap (Transport *obj, bool remove)
 
template<>
void AddToActive (Creature *c)
 
template<>
void AddToActive (DynamicObject *d)
 
template<>
void RemoveFromActive (Creature *c)
 
template<>
void RemoveFromActive (DynamicObject *obj)
 
- Public Member Functions inherited from GridRefManager< NGridType >
GridReference< NGridType > * getFirst ()
 
GridReference< NGridType > * getLast ()
 
iterator begin ()
 
iterator end ()
 
iterator rbegin ()
 
iterator rend ()
 
- Public Member Functions inherited from RefManager< GridRefManager< NGridType >, NGridType >
 RefManager ()
 
virtual ~RefManager ()
 
Reference< GridRefManager
< NGridType >, NGridType > * 
getFirst ()
 
Reference< GridRefManager
< NGridType >, NGridType >
const
getFirst () const
 
Reference< GridRefManager
< NGridType >, NGridType > * 
getLast ()
 
Reference< GridRefManager
< NGridType >, NGridType >
const
getLast () const
 
iterator begin ()
 
iterator end ()
 
iterator rbegin ()
 
iterator rend ()
 
void clearReferences ()
 
- Public Member Functions inherited from LinkedListHead
 LinkedListHead ()
 
virtual ~LinkedListHead ()
 
bool isEmpty () const
 
LinkedListElementgetFirst ()
 
LinkedListElement constgetFirst () const
 
LinkedListElementgetLast ()
 
LinkedListElement constgetLast () const
 
void insertFirst (LinkedListElement *pElem)
 
void insertLast (LinkedListElement *pElem)
 
uint32 getSize () const
 
void incSize ()
 
void decSize ()
 

Private Attributes

ObjectGuid _owner
 
Player_loadingPlayer
 Player is not registered in ObjectAccessor during login More...
 

Additional Inherited Members

- Public Types inherited from Map
enum  EnterState {
  CAN_ENTER = 0, CANNOT_ENTER_ALREADY_IN_MAP = 1, CANNOT_ENTER_NO_ENTRY, CANNOT_ENTER_UNINSTANCED_DUNGEON,
  CANNOT_ENTER_DIFFICULTY_UNAVAILABLE, CANNOT_ENTER_NOT_IN_RAID, CANNOT_ENTER_CORPSE_IN_DIFFERENT_INSTANCE, CANNOT_ENTER_INSTANCE_BIND_MISMATCH,
  CANNOT_ENTER_TOO_MANY_INSTANCES, CANNOT_ENTER_MAX_PLAYERS, CANNOT_ENTER_ZONE_IN_COMBAT, CANNOT_ENTER_UNSPECIFIED_REASON
}
 
typedef MapRefManager PlayerList
 
typedef
std::unordered_multimap
< ObjectGuid::LowType,
Creature * > 
CreatureBySpawnIdContainer
 
typedef
std::unordered_multimap
< ObjectGuid::LowType,
GameObject * > 
GameObjectBySpawnIdContainer
 
- Public Types inherited from GridRefManager< NGridType >
typedef
LinkedListHead::Iterator
< GridReference< NGridType > > 
iterator
 
- Public Types inherited from RefManager< GridRefManager< NGridType >, NGridType >
typedef
LinkedListHead::Iterator
< Reference< GridRefManager
< NGridType >, NGridType > > 
iterator
 
- Public Types inherited from LinkedListHead
typedef Iterator
< LinkedListElement
iterator
 
- Static Public Member Functions inherited from Map
static bool ExistMap (uint32 mapid, int gx, int gy)
 
static bool ExistVMap (uint32 mapid, int gx, int gy)
 
static void InitStateMachine ()
 
static void DeleteStateMachine ()
 
static void DeleteRespawnTimesInDB (uint16 mapId, uint32 instanceId)
 
- Public Attributes inherited from Map
CreatureGroupHolderType CreatureGroupHolder
 
- Protected Types inherited from Map
typedef std::set< WorldObject * > ActiveNonPlayers
 
typedef std::set< Transport * > TransportsContainer
 
- Protected Member Functions inherited from Map
void SetUnloadReferenceLock (const GridCoord &p, bool on)
 
- Protected Attributes inherited from Map
std::mutex _mapLock
 
std::mutex _gridLock
 
MapEntry consti_mapEntry
 
uint8 i_spawnMode
 
uint32 i_InstanceId
 
uint32 m_unloadTimer
 
float m_VisibleDistance
 
DynamicMapTree _dynamicTree
 
MapRefManager m_mapRefManager
 
MapRefManager::iterator m_mapRefIter
 
int32 m_VisibilityNotifyPeriod
 
ActiveNonPlayers m_activeNonPlayers
 
ActiveNonPlayers::iterator m_activeNonPlayersIter
 
TransportsContainer _transports
 
TransportsContainer::iterator _transportsUpdateIter
 

Constructor & Destructor Documentation

GarrisonMap::GarrisonMap ( uint32  id,
time_t  expiry,
uint32  instanceId,
Map parent,
ObjectGuid const owner 
)
100  : Map(id, expiry, instanceId, DIFFICULTY_NORMAL, parent), _owner(owner), _loadingPlayer(nullptr)
101 {
103 }
ObjectGuid _owner
Definition: GarrisonMap.h:39
void InitVisibilityDistance() override
Definition: GarrisonMap.cpp:124
Map(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode, Map *_parent=NULL)
Definition: Map.cpp:227
Player * _loadingPlayer
Player is not registered in ObjectAccessor during login
Definition: GarrisonMap.h:40
Definition: DBCEnums.h:405

+ Here is the call graph for this function:

Member Function Documentation

bool GarrisonMap::AddPlayerToMap ( Player player,
bool  initPlayer = true 
)
overridevirtual

Reimplemented from Map.

132 {
133  if (player->GetGUID() == _owner)
134  _loadingPlayer = player;
135 
136  bool result = Map::AddPlayerToMap(player, initPlayer);
137 
138  if (player->GetGUID() == _owner)
139  _loadingPlayer = nullptr;
140 
141  return result;
142 }
ObjectGuid _owner
Definition: GarrisonMap.h:39
Player * _loadingPlayer
Player is not registered in ObjectAccessor during login
Definition: GarrisonMap.h:40
virtual bool AddPlayerToMap(Player *player, bool initPlayer=true)
Definition: Map.cpp:513

+ Here is the call graph for this function:

Garrison * GarrisonMap::GetGarrison ( )
114 {
115  if (_loadingPlayer)
116  return _loadingPlayer->GetGarrison();
117 
119  return owner->GetGarrison();
120 
121  return nullptr;
122 }
ObjectGuid _owner
Definition: GarrisonMap.h:39
Player * _loadingPlayer
Player is not registered in ObjectAccessor during login
Definition: GarrisonMap.h:40
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

void GarrisonMap::InitVisibilityDistance ( )
overridevirtual

Reimplemented from Map.

125 {
126  //init visibility distance for instances
129 }
float m_VisibleDistance
Definition: Map.h:644
static float GetMaxVisibleDistanceInBGArenas()
Definition: World.h:731
static int32 GetVisibilityNotifyPeriodInBGArenas()
Definition: World.h:735
int32 m_VisibilityNotifyPeriod
Definition: Map.h:650

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GarrisonMap::LoadGridObjects ( NGridType grid,
Cell const cell 
)
overridevirtual

Reimplemented from Map.

106 {
107  Map::LoadGridObjects(grid, cell);
108 
109  GarrisonGridLoader loader(grid, this, cell);
110  loader.LoadN();
111 }
virtual void LoadGridObjects(NGridType *grid, Cell const &cell)
Definition: Map.cpp:502
Definition: GarrisonMap.cpp:24

+ Here is the call graph for this function:

Member Data Documentation

Player* GarrisonMap::_loadingPlayer
private

Player is not registered in ObjectAccessor during login

ObjectGuid GarrisonMap::_owner
private

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