TrinityCore
Loading...
Searching...
No Matches
ObjectGuid.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITYCORE_OBJECT_GUID_H
19#define TRINITYCORE_OBJECT_GUID_H
20
21#include "Define.h"
22#include "EnumFlag.h"
23#include "Hash.h"
24#include "StringFormatFwd.h"
25#include "advstd.h"
26#include <array>
27#include <functional>
28#include <list>
29#include <set>
30#include <span>
31#include <string>
32#include <type_traits>
33#include <unordered_set>
34#include <vector>
35
59
84
107
108enum class HighGuid
109{
110 Null = 0,
111 Uniq = 1,
112 Player = 2,
113 Item = 3,
115 StaticDoor = 5, //NYI
116 Transport = 6,
117 Conversation = 7,
118 Creature = 8,
119 Vehicle = 9,
120 Pet = 10,
121 GameObject = 11,
122 DynamicObject = 12,
123 AreaTrigger = 13,
124 Corpse = 14,
125 LootObject = 15,
126 SceneObject = 16,
127 Scenario = 17,
128 AIGroup = 18,
129 DynamicDoor = 19,
130 ClientActor = 20, //NYI
131 Vignette = 21,
132 CallForHelp = 22,
133 AIResource = 23,
134 AILock = 24,
135 AILockTicket = 25,
136 ChatChannel = 26,
137 Party = 27,
138 Guild = 28,
139 WowAccount = 29,
140 BNetAccount = 30,
141 GMTask = 31,
142 MobileSession = 32, //NYI
143 RaidGroup = 33,
144 Spell = 34,
145 Mail = 35,
146 WebObj = 36, //NYI
147 LFGObject = 37, //NYI
148 LFGList = 38, //NYI
149 UserRouter = 39,
150 PVPQueueGroup = 40,
151 UserClient = 41,
152 PetBattle = 42, //NYI
153 UniqUserClient = 43,
154 BattlePet = 44,
155 CommerceObj = 45,
156 ClientSession = 46,
157 Cast = 47,
158 ClientConnection = 48,
159 ClubFinder = 49,
160 ToolsClient = 50,
161 WorldLayer = 51,
162 ArenaTeam = 52,
163 LMMParty = 53,
164 LMMLobby = 54,
165 Housing = 55,
166 MeshObject = 56,
167 Entity = 57,
168
169 Count,
170};
171
173{
174 None = 0x0,
175 Global = 0x1,
176 Realm = 0x2,
177 Map = 0x4
178};
179
181
183{
184 Null,
185 Uniq,
186 Player,
187 Item,
189 Transport,
192 Global,
193 Guild,
195 WebObj,
196 LFGObject,
197 LFGList,
198 Client,
202 LMMLobby,
203 Housing,
204};
205
206template<HighGuid high>
208{
210 using Format = std::integral_constant<ObjectGuidFormatType, ObjectGuidFormatType::Null>;
211};
212
213#define MAKE_GUID_TRAIT(high, sequence, format) \
214 template<> struct ObjectGuidTraits<high> \
215 { \
216 static constexpr EnumFlag<ObjectGuidSequenceSource> SequenceSource = sequence; \
217 using Format = std::integral_constant<ObjectGuidFormatType, format>; \
218 }
219
278
279class ByteBuffer;
280class ObjectGuid;
281
283{
284public:
285 static constexpr ObjectGuid CreateNull();
286 static constexpr ObjectGuid CreateUniq(uint64 id);
287 static ObjectGuid CreatePlayer(uint32 realmId, uint8 subType, uint32 arg1, uint64 dbId);
288 static ObjectGuid CreateItem(uint32 realmId, uint64 dbId);
289 static ObjectGuid CreateWorldObject(HighGuid type, uint8 subType, uint32 realmId, uint16 mapId, uint32 serverId, uint32 entry, uint64 counter);
290 static ObjectGuid CreateTransport(HighGuid type, uint32 counter);
291 static ObjectGuid CreateClientActor(uint16 ownerType, uint16 ownerId, uint32 counter);
292 static ObjectGuid CreateChatChannel(uint32 realmId, bool builtIn, bool trade, uint16 zoneId, uint8 factionGroupMask, uint64 counter);
293 static ObjectGuid CreateGlobal(HighGuid type, uint64 dbIdHigh, uint64 dbId);
294 static ObjectGuid CreateGuild(HighGuid type, uint32 realmId, uint64 dbId);
295 static ObjectGuid CreateMobileSession(uint32 realmId, uint16 arg1, uint64 counter);
296 static ObjectGuid CreateWebObj(uint32 realmId, uint8 arg1, uint8 arg2, uint64 counter);
297 static ObjectGuid CreateLFGObject(uint8 arg1, uint8 arg2, uint8 arg3, uint8 arg4, bool arg5, uint8 arg6, uint64 counter);
298 static ObjectGuid CreateLFGList(uint8 arg1, uint64 counter);
299 static ObjectGuid CreateClient(HighGuid type, uint32 realmId, uint32 arg1, uint64 counter);
300 static ObjectGuid CreateClubFinder(uint32 realmId, uint8 type, uint32 clubFinderId, uint64 dbId);
301 static ObjectGuid CreateToolsClient(uint16 mapId, uint32 serverId, uint64 counter);
302 static ObjectGuid CreateWorldLayer(uint32 arg1, uint16 arg2, uint8 arg3, uint32 arg4);
303 static ObjectGuid CreateLMMLobby(uint32 realmId, uint32 arg2, uint8 arg3, uint8 arg4, uint64 counter);
304 static ObjectGuid CreateHousing(uint32 subType, uint32 arg1, uint32 arg2, uint64 arg3);
305};
306
308{
309 friend class ObjectGuidFactory;
310 friend TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, ObjectGuid const& guid);
312
313 public:
314 static ObjectGuid const Empty;
317 static ObjectGuid const TradeItem;
318
319 static constexpr std::size_t BytesSize = 16;
320
322
323 constexpr ObjectGuid() = default;
324
325 uint64 GetRawValue(std::size_t i) const { return _data[i]; }
326 std::span<uint8 const, 16> GetRawValue() const { return std::span<uint8 const, 16>(reinterpret_cast<uint8 const*>(_data.data()), BytesSize); }
327 void SetRawValue(std::span<uint8 const> rawBytes);
328 void SetRawValue(uint64 high, uint64 low) { _data[0] = low; _data[1] = high; }
329 void Clear() { _data = { }; }
330
331 HighGuid GetHigh() const { return HighGuid((_data[1] >> 58) & 0x3F); }
332 uint32 GetRealmId() const { return uint32((_data[1] >> 42) & 0xFFFF); }
333 uint32 GetMapId() const { return uint32((_data[1] >> 29) & 0x1FFF); }
334 uint32 GetEntry() const { return uint32((_data[1] >> 6) & 0x7FFFFF); }
335 uint32 GetSubType() const { return uint32(_data[1] & 0x3F); }
337 {
338 switch (GetHigh())
339 {
341 return (_data[1] >> 38) & UI64LIT(0xFFFFF);
342 default:
343 break;
344 }
345 return _data[0] & UI64LIT(0x000000FFFFFFFFFF);
346 }
347
349 {
350 switch (high)
351 {
353 return UI64LIT(0xFFFFF);
354 default:
355 break;
356 }
357 return UI64LIT(0xFFFFFFFFFF);
358 }
359
360 LowType GetMaxCounter() const { return GetMaxCounter(GetHigh()); }
361
362 bool IsEmpty() const { return _data[0] == 0 && _data[1] == 0; }
363 bool IsCreature() const { return GetHigh() == HighGuid::Creature; }
364 bool IsPet() const { return GetHigh() == HighGuid::Pet; }
365 bool IsVehicle() const { return GetHigh() == HighGuid::Vehicle; }
366 bool IsCreatureOrPet() const { return IsCreature() || IsPet(); }
367 bool IsCreatureOrVehicle() const { return IsCreature() || IsVehicle(); }
368 bool IsAnyTypeCreature() const { return IsCreature() || IsPet() || IsVehicle(); }
369 bool IsPlayer() const { return !IsEmpty() && GetHigh() == HighGuid::Player; }
370 bool IsUnit() const { return IsAnyTypeCreature() || IsPlayer(); }
371 bool IsItem() const { return GetHigh() == HighGuid::Item; }
372 bool IsGameObject() const { return GetHigh() == HighGuid::GameObject; }
373 bool IsDynamicObject() const { return GetHigh() == HighGuid::DynamicObject; }
374 bool IsCorpse() const { return GetHigh() == HighGuid::Corpse; }
375 bool IsAreaTrigger() const { return GetHigh() == HighGuid::AreaTrigger; }
376 bool IsMOTransport() const { return GetHigh() == HighGuid::Transport; }
377 bool IsAnyTypeGameObject() const { return IsGameObject() || IsMOTransport(); }
378 bool IsParty() const { return GetHigh() == HighGuid::Party; }
379 bool IsGuild() const { return GetHigh() == HighGuid::Guild; }
380 bool IsSceneObject() const { return GetHigh() == HighGuid::SceneObject; }
381 bool IsConversation() const { return GetHigh() == HighGuid::Conversation; }
382 bool IsCast() const { return GetHigh() == HighGuid::Cast; }
383
384 bool operator!() const { return IsEmpty(); }
385 bool operator==(ObjectGuid const& right) const = default;
386 std::strong_ordering operator<=>(ObjectGuid const& right) const
387 {
388 if (std::strong_ordering cmp = _data[1] <=> right._data[1]; advstd::is_neq(cmp))
389 return cmp;
390 if (std::strong_ordering cmp = _data[0] <=> right._data[0]; advstd::is_neq(cmp))
391 return cmp;
392 return std::strong_ordering::equal;
393 }
394
395 static std::string_view GetTypeName(HighGuid high);
396 std::string_view GetTypeName() const { return !IsEmpty() ? GetTypeName(GetHigh()) : "None"; }
397 std::string ToString() const;
398 std::string ToHexString() const;
399 static ObjectGuid FromString(std::string_view guidString);
400
401 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Null, int32> = 0> static constexpr ObjectGuid Create() { return ObjectGuidFactory::CreateNull(); }
402 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Uniq, int32> = 0> static constexpr ObjectGuid Create(LowType id) { return ObjectGuidFactory::CreateUniq(id); }
403 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Player, int32> = 0> static ObjectGuid Create(LowType dbId) { return ObjectGuidFactory::CreatePlayer(0, 0, 0, dbId); }
404 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Item, int32> = 0> static ObjectGuid Create(LowType dbId) { return ObjectGuidFactory::CreateItem(0, dbId); }
405 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::WorldObject, int32> = 0> static ObjectGuid Create(uint16 mapId, uint32 entry, LowType counter) { return ObjectGuidFactory::CreateWorldObject(type, 0, 0, mapId, 0, entry, counter); }
406 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::WorldObject, int32> = 0> static ObjectGuid Create(uint8 subType, uint16 mapId, uint32 entry, LowType counter) { return ObjectGuidFactory::CreateWorldObject(type, subType, 0, mapId, 0, entry, counter); }
407 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Transport, int32> = 0> static ObjectGuid Create(uint32 counter) { return ObjectGuidFactory::CreateTransport(type, counter); }
408 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::ClientActor, int32> = 0> static ObjectGuid Create(uint16 ownerType, uint16 ownerId, uint32 counter) { return ObjectGuidFactory::CreateClientActor(ownerType, ownerId, counter); }
409 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::ChatChannel, int32> = 0> static ObjectGuid Create(bool builtIn, bool trade, uint16 zoneId, uint8 factionGroupMask, LowType counter) { return ObjectGuidFactory::CreateChatChannel(0, builtIn, trade, zoneId, factionGroupMask, counter); }
410 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Global, int32> = 0> static ObjectGuid Create(LowType dbId) { return ObjectGuidFactory::CreateGlobal(type, UI64LIT(0), dbId); }
411 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Guild, int32> = 0> static ObjectGuid Create(LowType dbId) { return ObjectGuidFactory::CreateGuild(type, 0, dbId); }
412 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::MobileSession, int32> = 0> static ObjectGuid Create(uint16 arg1, LowType counter) { return ObjectGuidFactory::CreateMobileSession(0, arg1, counter); }
413 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::WebObj, int32> = 0> static ObjectGuid Create(uint8 arg1, uint8 arg2, LowType counter) { return ObjectGuidFactory::CreateWebObj(0, arg1, arg2, counter); }
414 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::LFGObject, int32> = 0> static ObjectGuid Create(uint8 arg1, uint8 arg2, uint8 arg3, uint8 arg4, bool arg5, uint8 arg6, LowType counter) { return ObjectGuidFactory::CreateLFGObject(arg1, arg2, arg3, arg4, arg5, arg6, counter); }
415 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::LFGList, int32> = 0> static ObjectGuid Create(uint8 arg1, LowType counter) { return ObjectGuidFactory::CreateLFGList(arg1, counter); }
416 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Client, int32> = 0> static ObjectGuid Create(uint32 arg1, LowType counter) { return ObjectGuidFactory::CreateClient(type, 0, arg1, counter); }
417 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::ClubFinder, int32> = 0> static ObjectGuid Create(uint8 clubType, uint32 clubFinderId, LowType dbId) { return ObjectGuidFactory::CreateClubFinder(0, clubType, clubFinderId, dbId); }
418 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::ToolsClient, int32> = 0> static ObjectGuid Create(uint16 mapId, uint32 serverId, LowType counter) { return ObjectGuidFactory::CreateToolsClient(mapId, serverId, counter); }
419 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::WorldLayer, int32> = 0> static ObjectGuid Create(uint32 arg1, uint16 arg2, uint8 arg3, uint32 arg4) { return ObjectGuidFactory::CreateWorldLayer(arg1, arg2, arg3, arg4); }
420 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::LMMLobby, int32> = 0> static ObjectGuid Create(uint32 arg2, uint8 arg3, uint8 arg4, LowType counter) { return ObjectGuidFactory::CreateLMMLobby(0, arg2, arg3, arg4, counter); }
421 template <HighGuid type, std::enable_if_t<ObjectGuidTraits<type>::Format::value == ObjectGuidFormatType::Housing, int32> = 0> static ObjectGuid Create(uint32 subType, uint32 arg1, uint32 arg2, uint64 arg3) { return ObjectGuidFactory::CreateHousing(subType, arg1, arg2, arg3); }
422
423 protected:
424 constexpr ObjectGuid(uint64 high, uint64 low) : _data({{ low, high }})
425 {
426 }
427
428 std::array<uint64, 2> _data = { };
429};
430
431// Some Shared defines
432using GuidSet = std::set<ObjectGuid>;
433using GuidList = std::list<ObjectGuid>;
434using GuidVector = std::vector<ObjectGuid>;
435using GuidUnorderedSet = std::unordered_set<ObjectGuid>;
436
439
440template <>
441struct std::hash<ObjectGuid>
442{
443 std::size_t operator()(ObjectGuid const& key) const noexcept
444 {
445 return Trinity::HashFnv1a<>::GetHash(key.GetRawValue());
446 }
447};
448
449template <>
451{
452 template <typename FormatContext>
453 auto format(ObjectGuid const& guid, FormatContext& ctx) const -> decltype(ctx.out());
454};
455
456namespace Trinity
457{
458 namespace Legacy
459 {
460 enum class TypeID
461 {
462 Object = 0,
463 Item = 1,
464 Container = 2,
465 Unit = 3,
466 Player = 4,
467 GameObject = 5,
468 DynamicObject = 6,
469 Corpse = 7,
470 AreaTrigger = 8,
471 SceneObject = 9,
472 Conversation = 10,
473 Max
474 };
475
476 constexpr inline ::TypeID ConvertLegacyTypeID(TypeID legacyTypeID)
477 {
478 switch (legacyTypeID)
479 {
480 case TypeID::Object:
481 return TYPEID_OBJECT;
482 case TypeID::Item:
483 return TYPEID_ITEM;
485 return TYPEID_CONTAINER;
486 case TypeID::Unit:
487 return TYPEID_UNIT;
488 case TypeID::Player:
489 return TYPEID_PLAYER;
491 return TYPEID_GAMEOBJECT;
494 case TypeID::Corpse:
495 return TYPEID_CORPSE;
497 return TYPEID_AREATRIGGER;
499 return TYPEID_SCENEOBJECT;
501 return TYPEID_CONVERSATION;
502 default:
503 return TYPEID_OBJECT;
504 }
505 }
506
507 constexpr inline TypeMask ConvertLegacyTypeMask(uint32 legacyTypeMask)
508 {
509 uint32 typeMask = 0;
510 for (TypeID i = TypeID::Object; i < TypeID::Max; i = TypeID(uint32(i) + 1))
511 if (legacyTypeMask & (1 << uint32(i)))
512 typeMask |= 1u << ConvertLegacyTypeID(i);
513
514 return TypeMask(typeMask);
515 }
516 }
517}
518
519#endif // TRINITYCORE_OBJECT_GUID_H
#define TC_GAME_API
Definition Define.h:129
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
#define UI64LIT(N)
Definition Define.h:139
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
#define DEFINE_ENUM_FLAG(enumType)
Definition EnumFlag.h:26
ByteBuffer & operator<<(ByteBuffer &buf, ObjectGuid const &guid)
ByteBuffer & operator>>(ByteBuffer &buf, ObjectGuid &guid)
std::list< ObjectGuid > GuidList
Definition ObjectGuid.h:433
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition ObjectGuid.h:435
constexpr std::array< uint32, NUM_CLIENT_OBJECT_TYPES+1 > ObjectTypeMask
Definition ObjectGuid.h:85
TC_GAME_API ByteBuffer & operator>>(ByteBuffer &buf, ObjectGuid &guid)
TypeID
Definition ObjectGuid.h:37
@ TYPEID_AZERITE_ITEM
Definition ObjectGuid.h:42
@ TYPEID_OBJECT
Definition ObjectGuid.h:38
@ TYPEID_AREATRIGGER
Definition ObjectGuid.h:49
@ TYPEID_LOOT_OBJECT
Definition ObjectGuid.h:55
@ TYPEID_AI_GROUP
Definition ObjectGuid.h:53
@ TYPEID_ACTIVE_PLAYER
Definition ObjectGuid.h:45
@ TYPEID_DYNAMICOBJECT
Definition ObjectGuid.h:47
@ NUM_CLIENT_OBJECT_TYPES
Definition ObjectGuid.h:57
@ TYPEID_GAMEOBJECT
Definition ObjectGuid.h:46
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_MESH_OBJECT
Definition ObjectGuid.h:52
@ TYPEID_CORPSE
Definition ObjectGuid.h:48
@ TYPEID_ITEM
Definition ObjectGuid.h:39
@ TYPEID_SCENEOBJECT
Definition ObjectGuid.h:50
@ TYPEID_CONVERSATION
Definition ObjectGuid.h:51
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
@ TYPEID_AZERITE_EMPOWERED_ITEM
Definition ObjectGuid.h:41
@ TYPEID_SCENARIO
Definition ObjectGuid.h:54
@ TYPEID_CONTAINER
Definition ObjectGuid.h:40
std::set< ObjectGuid > GuidSet
Definition ObjectGuid.h:432
#define MAKE_GUID_TRAIT(high, sequence, format)
Definition ObjectGuid.h:213
HighGuid
Definition ObjectGuid.h:109
@ UniqUserClient
@ WorldTransaction
@ ClientConnection
TypeMask
Definition ObjectGuid.h:61
@ TYPEMASK_LOOT_OBJECT
Definition ObjectGuid.h:79
@ TYPEMASK_OBJECT
Definition ObjectGuid.h:62
@ TYPEMASK_ITEM
Definition ObjectGuid.h:63
@ TYPEMASK_SCENEOBJECT
Definition ObjectGuid.h:74
@ TYPEMASK_DYNAMICOBJECT
Definition ObjectGuid.h:71
@ TYPEMASK_SEER
Definition ObjectGuid.h:81
@ TYPEMASK_AZERITE_ITEM
Definition ObjectGuid.h:66
@ TYPEMASK_UNIT
Definition ObjectGuid.h:67
@ TYPEMASK_CONVERSATION
Definition ObjectGuid.h:75
@ TYPEMASK_CONTAINER
Definition ObjectGuid.h:64
@ TYPEMASK_CORPSE
Definition ObjectGuid.h:72
@ TYPEMASK_MESH_OBJECT
Definition ObjectGuid.h:76
@ TYPEMASK_GAMEOBJECT
Definition ObjectGuid.h:70
@ TYPEMASK_WORLDOBJECT
Definition ObjectGuid.h:82
@ TYPEMASK_AI_GROUP
Definition ObjectGuid.h:77
@ TYPEMASK_PLAYER
Definition ObjectGuid.h:68
@ TYPEMASK_AREATRIGGER
Definition ObjectGuid.h:73
@ TYPEMASK_SCENARIO
Definition ObjectGuid.h:78
@ TYPEMASK_ACTIVE_PLAYER
Definition ObjectGuid.h:69
@ TYPEMASK_AZERITE_EMPOWERED_ITEM
Definition ObjectGuid.h:65
ObjectGuidSequenceSource
Definition ObjectGuid.h:173
ObjectGuidFormatType
Definition ObjectGuid.h:183
TC_GAME_API ByteBuffer & operator<<(ByteBuffer &buf, ObjectGuid const &guid)
std::vector< ObjectGuid > GuidVector
Definition ObjectGuid.h:434
Definition Guild.h:329
Definition Item.h:179
Definition Map.h:225
static ObjectGuid CreateTransport(HighGuid type, uint32 counter)
static ObjectGuid CreateHousing(uint32 subType, uint32 arg1, uint32 arg2, uint64 arg3)
static ObjectGuid CreateGlobal(HighGuid type, uint64 dbIdHigh, uint64 dbId)
static ObjectGuid CreateItem(uint32 realmId, uint64 dbId)
static ObjectGuid CreateWorldLayer(uint32 arg1, uint16 arg2, uint8 arg3, uint32 arg4)
static ObjectGuid CreateLMMLobby(uint32 realmId, uint32 arg2, uint8 arg3, uint8 arg4, uint64 counter)
static ObjectGuid CreateMobileSession(uint32 realmId, uint16 arg1, uint64 counter)
static ObjectGuid CreateClubFinder(uint32 realmId, uint8 type, uint32 clubFinderId, uint64 dbId)
static ObjectGuid CreateClient(HighGuid type, uint32 realmId, uint32 arg1, uint64 counter)
static ObjectGuid CreateClientActor(uint16 ownerType, uint16 ownerId, uint32 counter)
static ObjectGuid CreateToolsClient(uint16 mapId, uint32 serverId, uint64 counter)
static ObjectGuid CreatePlayer(uint32 realmId, uint8 subType, uint32 arg1, uint64 dbId)
static ObjectGuid CreateGuild(HighGuid type, uint32 realmId, uint64 dbId)
static ObjectGuid CreateWorldObject(HighGuid type, uint8 subType, uint32 realmId, uint16 mapId, uint32 serverId, uint32 entry, uint64 counter)
static ObjectGuid CreateChatChannel(uint32 realmId, bool builtIn, bool trade, uint16 zoneId, uint8 factionGroupMask, uint64 counter)
static constexpr ObjectGuid CreateUniq(uint64 id)
static ObjectGuid CreateLFGList(uint8 arg1, uint64 counter)
static constexpr ObjectGuid CreateNull()
static ObjectGuid CreateLFGObject(uint8 arg1, uint8 arg2, uint8 arg3, uint8 arg4, bool arg5, uint8 arg6, uint64 counter)
static ObjectGuid CreateWebObj(uint32 realmId, uint8 arg1, uint8 arg2, uint64 counter)
uint32 GetMapId() const
Definition ObjectGuid.h:333
static LowType GetMaxCounter(HighGuid high)
Definition ObjectGuid.h:348
static ObjectGuid Create(uint32 arg1, LowType counter)
Definition ObjectGuid.h:416
LowType GetCounter() const
Definition ObjectGuid.h:336
static ObjectGuid Create(uint8 arg1, uint8 arg2, LowType counter)
Definition ObjectGuid.h:413
static ObjectGuid const Empty
Definition ObjectGuid.h:314
static ObjectGuid Create(uint32 arg1, uint16 arg2, uint8 arg3, uint32 arg4)
Definition ObjectGuid.h:419
bool IsAnyTypeGameObject() const
Definition ObjectGuid.h:377
static ObjectGuid Create(uint8 clubType, uint32 clubFinderId, LowType dbId)
Definition ObjectGuid.h:417
bool IsCorpse() const
Definition ObjectGuid.h:374
static ObjectGuid Create(uint16 ownerType, uint16 ownerId, uint32 counter)
Definition ObjectGuid.h:408
static ObjectGuid const ToStringFailed
Definition ObjectGuid.h:315
std::span< uint8 const, 16 > GetRawValue() const
Definition ObjectGuid.h:326
bool IsEmpty() const
Definition ObjectGuid.h:362
bool IsAreaTrigger() const
Definition ObjectGuid.h:375
static ObjectGuid Create(uint32 counter)
Definition ObjectGuid.h:407
static ObjectGuid Create(bool builtIn, bool trade, uint16 zoneId, uint8 factionGroupMask, LowType counter)
Definition ObjectGuid.h:409
uint64 GetRawValue(std::size_t i) const
Definition ObjectGuid.h:325
void SetRawValue(uint64 high, uint64 low)
Definition ObjectGuid.h:328
bool operator==(ObjectGuid const &right) const =default
bool IsSceneObject() const
Definition ObjectGuid.h:380
static ObjectGuid const FromStringFailed
Definition ObjectGuid.h:316
bool IsMOTransport() const
Definition ObjectGuid.h:376
bool IsItem() const
Definition ObjectGuid.h:371
bool IsPlayer() const
Definition ObjectGuid.h:369
bool IsUnit() const
Definition ObjectGuid.h:370
static ObjectGuid Create(uint16 mapId, uint32 serverId, LowType counter)
Definition ObjectGuid.h:418
bool IsVehicle() const
Definition ObjectGuid.h:365
std::string_view GetTypeName() const
Definition ObjectGuid.h:396
bool IsCast() const
Definition ObjectGuid.h:382
static constexpr ObjectGuid Create()
Definition ObjectGuid.h:401
static ObjectGuid Create(uint8 arg1, LowType counter)
Definition ObjectGuid.h:415
bool IsDynamicObject() const
Definition ObjectGuid.h:373
LowType GetMaxCounter() const
Definition ObjectGuid.h:360
bool IsGameObject() const
Definition ObjectGuid.h:372
static ObjectGuid Create(LowType dbId)
Definition ObjectGuid.h:403
static ObjectGuid Create(uint8 subType, uint16 mapId, uint32 entry, LowType counter)
Definition ObjectGuid.h:406
static ObjectGuid Create(uint32 arg2, uint8 arg3, uint8 arg4, LowType counter)
Definition ObjectGuid.h:420
bool IsCreatureOrPet() const
Definition ObjectGuid.h:366
std::strong_ordering operator<=>(ObjectGuid const &right) const
Definition ObjectGuid.h:386
bool IsParty() const
Definition ObjectGuid.h:378
constexpr ObjectGuid(uint64 high, uint64 low)
Definition ObjectGuid.h:424
bool operator!() const
Definition ObjectGuid.h:384
std::array< uint64, 2 > _data
Definition ObjectGuid.h:428
uint32 GetEntry() const
Definition ObjectGuid.h:334
static ObjectGuid const TradeItem
Definition ObjectGuid.h:317
static constexpr ObjectGuid Create(LowType id)
Definition ObjectGuid.h:402
static ObjectGuid Create(uint16 arg1, LowType counter)
Definition ObjectGuid.h:412
bool IsGuild() const
Definition ObjectGuid.h:379
uint32 GetSubType() const
Definition ObjectGuid.h:335
bool IsAnyTypeCreature() const
Definition ObjectGuid.h:368
uint64 LowType
Definition ObjectGuid.h:321
bool IsCreatureOrVehicle() const
Definition ObjectGuid.h:367
static ObjectGuid Create(uint8 arg1, uint8 arg2, uint8 arg3, uint8 arg4, bool arg5, uint8 arg6, LowType counter)
Definition ObjectGuid.h:414
uint32 GetRealmId() const
Definition ObjectGuid.h:332
HighGuid GetHigh() const
Definition ObjectGuid.h:331
bool IsCreature() const
Definition ObjectGuid.h:363
static ObjectGuid Create(uint32 subType, uint32 arg1, uint32 arg2, uint64 arg3)
Definition ObjectGuid.h:421
bool IsPet() const
Definition ObjectGuid.h:364
void Clear()
Definition ObjectGuid.h:329
static ObjectGuid Create(uint16 mapId, uint32 entry, LowType counter)
Definition ObjectGuid.h:405
constexpr ObjectGuid()=default
bool IsConversation() const
Definition ObjectGuid.h:381
Definition Pet.h:40
Definition Spell.h:277
Definition Unit.h:635
constexpr TypeMask ConvertLegacyTypeMask(uint32 legacyTypeMask)
Definition ObjectGuid.h:507
constexpr ::TypeID ConvertLegacyTypeID(TypeID legacyTypeID)
Definition ObjectGuid.h:476
constexpr bool is_neq(std::partial_ordering cmp) noexcept
Definition advstd.h:35
Definition Mail.h:175
std::integral_constant< ObjectGuidFormatType, ObjectGuidFormatType::Null > Format
Definition ObjectGuid.h:210
static constexpr EnumFlag< ObjectGuidSequenceSource > SequenceSource
Definition ObjectGuid.h:209
Definition Realm.h:139
static constexpr std::size_t GetHash(std::span< V, Extent > data) noexcept
Definition Hash.h:130
auto format(ObjectGuid const &guid, FormatContext &ctx) const -> decltype(ctx.out())
std::size_t operator()(ObjectGuid const &key) const noexcept
Definition ObjectGuid.h:443