diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/game/MapManager.h | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/game/MapManager.h')
-rw-r--r-- | src/game/MapManager.h | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/game/MapManager.h b/src/game/MapManager.h index f9e64240686..5e7db0e4263 100644 --- a/src/game/MapManager.h +++ b/src/game/MapManager.h @@ -17,32 +17,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef TRINITY_MAPMANAGER_H #define TRINITY_MAPMANAGER_H - #include "Platform/Define.h" #include "Policies/Singleton.h" #include "ace/Thread_Mutex.h" #include "Common.h" #include "Map.h" #include "GridStates.h" - class Transport; - class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::ClassLevelLockable<MapManager, ACE_Thread_Mutex> > { - friend class Trinity::OperatorNew<MapManager>; typedef UNORDERED_MAP<uint32, Map*> MapMapType; typedef std::pair<UNORDERED_MAP<uint32, Map*>::iterator, bool> MapMapPair; - public: - Map* CreateMap(uint32, const WorldObject* obj, uint32 instanceId); Map const* CreateBaseMap(uint32 id) const { return const_cast<MapManager*>(this)->_createBaseMap(id); } Map* FindMap(uint32 mapid, uint32 instanceId = 0) const; - uint16 GetAreaFlag(uint32 mapid, float x, float y, float z) const { Map const* m = CreateBaseMap(mapid); @@ -60,10 +52,8 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS:: { Map::GetZoneAndAreaIdByAreaFlag(zoneid,areaid,GetAreaFlag(mapid, x, y, z),mapid); } - void Initialize(void); void Update(uint32); - void SetGridCleanUpDelay(uint32 t) { if( t < MIN_GRID_DELAY ) @@ -71,62 +61,47 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS:: else i_gridCleanUpDelay = t; } - void SetMapUpdateInterval(uint32 t) { if( t > MIN_MAP_UPDATE_DELAY ) t = MIN_MAP_UPDATE_DELAY; - i_timer.SetInterval(t); i_timer.Reset(); } - //void LoadGrid(int mapid, int instId, float x, float y, const WorldObject* obj, bool no_unload = false); void UnloadAll(); - static bool ExistMapAndVMap(uint32 mapid, float x, float y); static bool IsValidMAP(uint32 mapid); - static bool IsValidMapCoord(uint32 mapid, float x,float y) { return IsValidMAP(mapid) && Trinity::IsValidMapCoord(x,y); } - static bool IsValidMapCoord(uint32 mapid, float x,float y,float z) { return IsValidMAP(mapid) && Trinity::IsValidMapCoord(x,y,z); } - static bool IsValidMapCoord(uint32 mapid, float x,float y,float z,float o) { return IsValidMAP(mapid) && Trinity::IsValidMapCoord(x,y,z,o); } - static bool IsValidMapCoord(WorldLocation const& loc) { return IsValidMapCoord(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), loc.GetOrientation()); } - void DoDelayedMovesAndRemoves(); - void LoadTransports(); - typedef std::set<Transport *> TransportSet; TransportSet m_Transports; - typedef std::map<uint32, TransportSet> TransportMap; TransportMap m_TransportsByMap; - bool CanPlayerEnter(uint32 mapid, Player* player); void RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y); uint32 GenerateInstanceId() { return ++i_MaxInstanceId; } void InitMaxInstanceId(); void InitializeVisibilityDistanceInfo(); - /* statistics */ uint32 GetNumInstances(); uint32 GetNumPlayersInInstances(); - private: // debugging code, should be deleted some day void checkAndCorrectGridStatesArray(); // just for debugging to find some memory overwrites @@ -135,22 +110,18 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS:: private: MapManager(); ~MapManager(); - MapManager(const MapManager &); MapManager& operator=(const MapManager &); - Map* _createBaseMap(uint32 id); Map* _findMap(uint32 id) const { MapMapType::const_iterator iter = i_maps.find(id); return (iter == i_maps.end() ? NULL : iter->second); } - typedef MaNGOS::ClassLevelLockable<MapManager, ACE_Thread_Mutex>::Lock Guard; uint32 i_gridCleanUpDelay; MapMapType i_maps; IntervalTimer i_timer; - uint32 i_MaxInstanceId; }; #endif |