diff options
| author | Bootz <Stage6Dev@EMPulseGaming.com> | 2011-10-07 19:45:43 -0500 |
|---|---|---|
| committer | Bootz <Stage6Dev@EMPulseGaming.com> | 2011-10-07 19:45:43 -0500 |
| commit | 5b4c7783c2a28e420cb4aaf4f2967083db8f6787 (patch) | |
| tree | 887be454d8d9d1a916d8085a243a2afaff2c0dbe /src/server/game/Maps | |
| parent | c89b1f6989ce1f5a48c48766993c3dd8101cc21b (diff) | |
REPO: Code-style clean-ups
* Fixed pMap->map
* Fixed pInstance->instance
* Fixed pInsta->instance
* Fixed pQuest->quest
* Fixed pWho->who
* Fixed pTarget->target
* Fixed pGo->go
~DEVNOTES: Handlers/QuestHandler.cpp still needs to be cleaned...
Diffstat (limited to 'src/server/game/Maps')
| -rwxr-xr-x | src/server/game/Maps/Map.cpp | 9 | ||||
| -rwxr-xr-x | src/server/game/Maps/Map.h | 8 | ||||
| -rwxr-xr-x | src/server/game/Maps/MapInstanced.cpp | 28 | ||||
| -rwxr-xr-x | src/server/game/Maps/MapInstanced.h | 6 | ||||
| -rwxr-xr-x | src/server/game/Maps/MapManager.cpp | 16 |
5 files changed, 32 insertions, 35 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index b283227bb58..fb535cff747 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -31,7 +31,6 @@ #include "ObjectMgr.h" #include "Group.h" - union u_map_magic { char asChar[4]; @@ -144,7 +143,7 @@ void Map::LoadMap(int gx, int gy, bool reload) if (!m_parentMap->GridMaps[gx][gy]) m_parentMap->EnsureGridCreated(GridPair(63-gx, 63-gy)); - ((MapInstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx, gy)); + ((Mainstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx, gy)); GridMaps[gx][gy] = m_parentMap->GridMaps[gx][gy]; return; } @@ -993,7 +992,7 @@ bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll) VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy); } else - ((MapInstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy)); + ((Mainstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy)); GridMaps[gx][gy] = NULL; } @@ -1604,7 +1603,6 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps, float maxSearchD return vmapHeight; else return mapHeight; // better use .map surface height - } else return vmapHeight; // we have only vmapHeight (if have) @@ -2656,7 +2654,6 @@ void BattlegroundMap::RemoveAllPlayers() if (Player* plr = itr->getSource()) if (!plr->IsBeingTeleportedFar()) plr->TeleportTo(plr->GetBattlegroundEntryPoint()); - } Creature* @@ -2681,4 +2678,4 @@ void Map::UpdateIteratorBack(Player* player) { if (m_mapRefIter == player->GetMapRef()) m_mapRefIter = m_mapRefIter->nocheck_prev(); -} +}
\ No newline at end of file diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 640b70413f8..c47ae6ac614 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -48,7 +48,7 @@ struct ScriptInfo; struct ScriptAction; struct Position; class Battleground; -class MapInstanced; +class Mainstanced; class InstanceMap; namespace Trinity { struct ObjectUpdater; } @@ -429,8 +429,8 @@ class Map : public GridRefManager<NGridType> GameObject* GetGameObject(uint64 guid); DynamicObject* GetDynamicObject(uint64 guid); - MapInstanced* ToMapInstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; } - const MapInstanced* ToMapInstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; } + Mainstanced* ToMainstanced(){ if (Instanceable()) return reinterpret_cast<Mainstanced*>(this); else return NULL; } + const Mainstanced* ToMainstanced() const { if (Instanceable()) return (const Mainstanced*)((Mainstanced*)this); else return NULL; } InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; } const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; } @@ -508,7 +508,7 @@ class Map : public GridRefManager<NGridType> time_t i_gridExpiry; - //used for fast base_map (e.g. MapInstanced class object) search for + //used for fast base_map (e.g. Mainstanced class object) search for //InstanceMaps and BattlegroundMaps... Map* m_parentMap; diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 88bfc9cdb69..aab2f469514 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -25,7 +25,7 @@ #include "World.h" #include "Group.h" -MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL) +Mainstanced::Mainstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL) { // initialize instanced maps list m_InstancedMaps.clear(); @@ -33,7 +33,7 @@ MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEO memset(&GridMapReference, 0, MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_GRIDS*sizeof(uint16)); } -void MapInstanced::InitVisibilityDistance() +void Mainstanced::InitVisibilityDistance() { if (m_InstancedMaps.empty()) return; @@ -44,7 +44,7 @@ void MapInstanced::InitVisibilityDistance() } } -void MapInstanced::Update(const uint32 t) +void Mainstanced::Update(const uint32 t) { // take care of loaded GridMaps (when unused, unload it!) Map::Update(t); @@ -73,7 +73,7 @@ void MapInstanced::Update(const uint32 t) } } -void MapInstanced::DelayedUpdate(const uint32 diff) +void Mainstanced::DelayedUpdate(const uint32 diff) { for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i) i->second->DelayedUpdate(diff); @@ -82,14 +82,14 @@ void MapInstanced::DelayedUpdate(const uint32 diff) } /* -void MapInstanced::RelocationNotify() +void Mainstanced::RelocationNotify() { for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i) i->second->RelocationNotify(); } */ -void MapInstanced::UnloadAll() +void Mainstanced::UnloadAll() { // Unload instanced maps for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i) @@ -110,7 +110,7 @@ void MapInstanced::UnloadAll() - create the instance if it's not created already - the player is not actually added to the instance (only in InstanceMap::Add) */ -Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player) +Map* Mainstanced::CreateInstance(const uint32 mapId, Player* player) { if (GetId() != mapId || !player) return NULL; @@ -170,7 +170,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player) return map; } -InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty) +InstanceMap* Mainstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty) { // load/create a map ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); @@ -192,7 +192,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, // some instances only have one difficulty GetDownscaledMapDifficultyData(GetId(), difficulty); - sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); + sLog->outDebug(LOG_FILTER_MAPS, "Mainstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); InstanceMap* map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this); ASSERT(map->IsDungeon()); @@ -204,12 +204,12 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, return map; } -BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg) +BattlegroundMap* Mainstanced::CreateBattleground(uint32 InstanceId, Battleground* bg) { // load/create a map ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); - sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Mainstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel()); @@ -230,7 +230,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun } // increments the iterator after erase -bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr) +bool Mainstanced::DestroyInstance(InstancedMaps::iterator &itr) { itr->second->RemoveAllPlayers(); if (itr->second->HavePlayers()) @@ -260,8 +260,8 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr) return true; } -bool MapInstanced::CanEnter(Player* /*player*/) +bool Mainstanced::CanEnter(Player* /*player*/) { //ASSERT(false); return true; -} +}
\ No newline at end of file diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h index 1913f0add51..2949a8ecb67 100755 --- a/src/server/game/Maps/MapInstanced.h +++ b/src/server/game/Maps/MapInstanced.h @@ -23,14 +23,14 @@ #include "InstanceSaveMgr.h" #include "DBCEnums.h" -class MapInstanced : public Map +class Mainstanced : public Map { friend class MapManager; public: typedef UNORDERED_MAP< uint32, Map*> InstancedMaps; - MapInstanced(uint32 id, time_t expiry); - ~MapInstanced() {} + Mainstanced(uint32 id, time_t expiry); + ~Mainstanced() {} // functions overwrite Map versions void Update(const uint32); diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 4684e96c79c..53159acc55d 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -106,7 +106,7 @@ Map* MapManager::_createBaseMap(uint32 id) const MapEntry* entry = sMapStore.LookupEntry(id); if (entry && entry->Instanceable()) { - m = new MapInstanced(id, i_gridCleanUpDelay); + m = new Mainstanced(id, i_gridCleanUpDelay); } else { @@ -125,7 +125,7 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj, uint32 /*instanceI //if (!obj->IsInWorld()) sLog->outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); Map* m = _createBaseMap(id); - if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((MapInstanced*)m)->CreateInstance(id, (Player*)obj); + if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((Mainstanced*)m)->CreateInstance(id, (Player*)obj); return m; } @@ -139,7 +139,7 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const if (!map->Instanceable()) return instanceId == 0 ? map : NULL; - return ((MapInstanced*)map)->FindMap(instanceId); + return ((Mainstanced*)map)->FindMap(instanceId); } bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) @@ -343,8 +343,8 @@ uint32 MapManager::GetNumInstances() Map* map = itr->second; if (!map->Instanceable()) continue; - MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps(); - for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr) + Mainstanced::InstancedMaps &maps = ((Mainstanced*)map)->GetInstancedMaps(); + for (Mainstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr) if (mitr->second->IsDungeon()) ret++; } return ret; @@ -360,8 +360,8 @@ uint32 MapManager::GetNumPlayersInInstances() Map* map = itr->second; if (!map->Instanceable()) continue; - MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps(); - for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr) + Mainstanced::InstancedMaps &maps = ((Mainstanced*)map)->GetInstancedMaps(); + for (Mainstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr) if (mitr->second->IsDungeon()) ret += ((InstanceMap*)mitr->second)->GetPlayers().getSize(); } @@ -432,4 +432,4 @@ void MapManager::FreeInstanceId(uint32 instanceId) SetNextInstanceId(instanceId); _instanceIds[instanceId] = false; -} +}
\ No newline at end of file |
