diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-10-26 02:57:28 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-10-26 02:57:28 +0200 |
commit | 9e1930959db59013d6f0221d29cc652cdf2f6145 (patch) | |
tree | 29218cc6af11c18f645eba3503583ed821975b2c /src/server/game/Globals/ObjectMgr.h | |
parent | 747350a0bcffaa4ef2b5d3317bb75fac78c64472 (diff) |
Core/Entities: Changed object lowguid to uint64
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.h')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 798998d3c12..186519e143f 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -479,7 +479,7 @@ struct BroadcastText typedef std::unordered_map<uint32, BroadcastText> BroadcastTextContainer; -typedef std::set<uint32> CellGuidSet; +typedef std::set<ObjectGuid::LowType> CellGuidSet; typedef std::map<ObjectGuid/*player guid*/, uint32/*instance*/> CellCorpseSet; struct CellObjectGuids { @@ -499,8 +499,8 @@ struct TrinityString }; typedef std::map<ObjectGuid, ObjectGuid> LinkedRespawnContainer; -typedef std::unordered_map<uint32, CreatureData> CreatureDataContainer; -typedef std::unordered_map<uint32, GameObjectData> GameObjectDataContainer; +typedef std::unordered_map<ObjectGuid::LowType, CreatureData> CreatureDataContainer; +typedef std::unordered_map<ObjectGuid::LowType, GameObjectData> GameObjectDataContainer; typedef std::map<TempSummonGroupKey, std::vector<TempSummonData> > TempSummonDataContainer; typedef std::unordered_map<uint32, CreatureLocale> CreatureLocaleContainer; typedef std::unordered_map<uint32, GameObjectLocale> GameObjectLocaleContainer; @@ -754,7 +754,7 @@ class ObjectMgr typedef std::map<uint32, uint32> CharacterConversionMap; - Player* GetPlayerByLowGUID(uint32 lowguid) const; + Player* GetPlayerByLowGUID(ObjectGuid::LowType lowguid) const; GameObjectTemplate const* GetGameObjectTemplate(uint32 entry); GameObjectTemplateContainer const* GetGameObjectTemplates() const { return &_gameObjectTemplateStore; } @@ -770,7 +770,7 @@ class ObjectMgr static uint32 ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = NULL); static void ChooseCreatureFlags(CreatureTemplate const* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data = NULL); EquipmentInfo const* GetEquipmentInfo(uint32 entry, int8& id); - CreatureAddon const* GetCreatureAddon(uint32 lowguid); + CreatureAddon const* GetCreatureAddon(ObjectGuid::LowType lowguid); CreatureAddon const* GetCreatureTemplateAddon(uint32 entry); ItemTemplate const* GetItemTemplate(uint32 entry); ItemTemplateContainer const* GetItemTemplateStore() const { return &_itemTemplateStore; } @@ -998,7 +998,7 @@ class ObjectMgr void LoadTempSummons(); void LoadCreatures(); void LoadLinkedRespawn(); - bool SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid); + bool SetCreatureLinkedRespawn(ObjectGuid::LowType guid, ObjectGuid::LowType linkedGuid); void LoadCreatureAddons(); void LoadCreatureModelInfo(); void LoadEquipmentTemplates(); @@ -1075,7 +1075,8 @@ class ObjectMgr CreatureBaseStats const* GetCreatureBaseStats(uint8 level, uint8 unitClass); void SetHighestGuids(); - uint32 GenerateLowGuid(HighGuid guidhigh); + template<HighGuid type> + ObjectGuidGenerator<type>* GetGenerator(); uint32 GenerateAuctionID(); uint64 GenerateEquipmentSetGuid(); uint32 GenerateMailID(); @@ -1136,14 +1137,14 @@ class ObjectMgr return NULL; } - CreatureData const* GetCreatureData(uint32 guid) const + CreatureData const* GetCreatureData(ObjectGuid::LowType guid) const { CreatureDataContainer::const_iterator itr = _creatureDataStore.find(guid); if (itr == _creatureDataStore.end()) return NULL; return &itr->second; } - CreatureData& NewOrExistCreatureData(uint32 guid) { return _creatureDataStore[guid]; } - void DeleteCreatureData(uint32 guid); + CreatureData& NewOrExistCreatureData(ObjectGuid::LowType guid) { return _creatureDataStore[guid]; } + void DeleteCreatureData(ObjectGuid::LowType guid); ObjectGuid GetLinkedRespawnGuid(ObjectGuid guid) const { LinkedRespawnContainer::const_iterator itr = _linkedRespawnStore.find(guid); @@ -1199,14 +1200,14 @@ class ObjectMgr return &itr->second; } - GameObjectData const* GetGOData(uint32 guid) const + GameObjectData const* GetGOData(ObjectGuid::LowType guid) const { GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid); if (itr == _gameObjectDataStore.end()) return NULL; return &itr->second; } - GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; } - void DeleteGOData(uint32 guid); + GameObjectData& NewGOData(ObjectGuid::LowType guid) { return _gameObjectDataStore[guid]; } + void DeleteGOData(ObjectGuid::LowType guid); TrinityString const* GetTrinityString(uint32 entry) const { @@ -1224,13 +1225,13 @@ class ObjectMgr void DeleteCorpseCellData(uint32 mapid, uint32 cellid, ObjectGuid player_guid); // grid objects - void AddCreatureToGrid(uint32 guid, CreatureData const* data); - void RemoveCreatureFromGrid(uint32 guid, CreatureData const* data); - void AddGameobjectToGrid(uint32 guid, GameObjectData const* data); - void RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data); - uint32 AddGOData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0, float rotation0 = 0, float rotation1 = 0, float rotation2 = 0, float rotation3 = 0); - uint32 AddCreData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0); - bool MoveCreData(uint32 guid, uint32 map, const Position& pos); + void AddCreatureToGrid(ObjectGuid::LowType guid, CreatureData const* data); + void RemoveCreatureFromGrid(ObjectGuid::LowType guid, CreatureData const* data); + void AddGameobjectToGrid(ObjectGuid::LowType guid, GameObjectData const* data); + void RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectData const* data); + ObjectGuid::LowType AddGOData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0, float rotation0 = 0, float rotation1 = 0, float rotation2 = 0, float rotation3 = 0); + ObjectGuid::LowType AddCreData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0); + bool MoveCreData(ObjectGuid::LowType guid, uint32 map, const Position& pos); // reserved names void LoadReservedPlayersNames(); @@ -1376,16 +1377,16 @@ class ObjectMgr uint64 _voidItemId; // first free low guid for selected guid type - uint32 _hiCharGuid; - uint32 _hiCreatureGuid; - uint32 _hiPetGuid; - uint32 _hiVehicleGuid; - uint32 _hiItemGuid; - uint32 _hiGoGuid; - uint32 _hiDoGuid; - uint32 _hiCorpseGuid; - uint32 _hiAreaTriggerGuid; - uint32 _hiMoTransGuid; + ObjectGuidGenerator<HIGHGUID_PLAYER> _playerGuidGenerator; + ObjectGuidGenerator<HIGHGUID_UNIT> _creatureGuidGenerator; + ObjectGuidGenerator<HIGHGUID_PET> _petGuidGenerator; + ObjectGuidGenerator<HIGHGUID_VEHICLE> _vehicleGuidGenerator; + ObjectGuidGenerator<HIGHGUID_ITEM> _itemGuidGenerator; + ObjectGuidGenerator<HIGHGUID_GAMEOBJECT> _gameObjectGuidGenerator; + ObjectGuidGenerator<HIGHGUID_DYNAMICOBJECT> _dynamicObjectGuidGenerator; + ObjectGuidGenerator<HIGHGUID_CORPSE> _corpseGuidGenerator; + ObjectGuidGenerator<HIGHGUID_AREATRIGGER> _areaTriggerGuidGenerator; + ObjectGuidGenerator<HIGHGUID_MO_TRANSPORT> _moTransportGuidGenerator; QuestMap _questTemplates; @@ -1432,7 +1433,7 @@ class ObjectMgr SpellScriptsContainer _spellScriptsStore; - VehicleAccessoryContainer _vehicleTemplateAccessoryStore; + VehicleAccessoryTemplateContainer _vehicleTemplateAccessoryStore; VehicleAccessoryContainer _vehicleAccessoryStore; LocaleConstant DBCLocaleIndex; @@ -1478,7 +1479,7 @@ class ObjectMgr CreatureTemplateContainer _creatureTemplateStore; CreatureModelContainer _creatureModelStore; CreatureAddonContainer _creatureAddonStore; - CreatureAddonContainer _creatureTemplateAddonStore; + CreatureTemplateAddonContainer _creatureTemplateAddonStore; EquipmentInfoContainer _equipmentInfoStore; LinkedRespawnContainer _linkedRespawnStore; CreatureLocaleContainer _creatureLocaleStore; |