30#include <unordered_set>
51#define NUM_CLIENT_OBJECT_TYPES 14
168template<HighGu
id high>
172 using Format = std::integral_constant<ObjectGuidFormatType, ObjectGuidFormatType::Null>;
175#define MAKE_GUID_TRAIT(high, sequence, format) \
176 template<> struct ObjectGuidTraits<high> \
178 static constexpr EnumFlag<ObjectGuidSequenceSource> SequenceSource = sequence; \
179 using Format = std::integral_constant<ObjectGuidFormatType, format>; \
283 std::vector<uint8> GetRawValue()
const;
284 void SetRawValue(std::vector<uint8>
const& guid);
298 return (_data[1] >> 38) &
UI64LIT(0xFFFFF);
302 return _data[0] &
UI64LIT(0x000000FFFFFFFFFF);
319 bool IsEmpty()
const {
return _data[0] == 0 && _data[1] == 0; }
349 return std::strong_ordering::equal;
355 std::string ToHexString()
const;
356 static ObjectGuid FromString(std::string
const& guidString);
364 template<HighGu
id type>
static std::enable_if_t<ObjectGuidTraits<type>::Format::value ==
ObjectGuidFormatType::WorldObject,
ObjectGuid>
Create(
uint8 subType,
uint16 mapId,
uint32 entry,
ObjectGuid::LowType counter) {
return ObjectGuidFactory::CreateWorldObject(type, subType, 0, mapId, 0, entry, counter); }
367 template<HighGu
id type>
static std::enable_if_t<ObjectGuidTraits<type>::Format::value ==
ObjectGuidFormatType::ChatChannel,
ObjectGuid>
Create(
bool builtIn,
bool trade,
uint16 zoneId,
uint8 factionGroupMask,
ObjectGuid::LowType counter) {
return ObjectGuidFactory::CreateChatChannel(0, builtIn, trade, zoneId, factionGroupMask, counter); }
372 template<HighGu
id type>
static std::enable_if_t<ObjectGuidTraits<type>::Format::value ==
ObjectGuidFormatType::LFGObject,
ObjectGuid>
Create(
uint8 arg1,
uint8 arg2,
uint8 arg3,
uint8 arg4,
bool arg5,
uint8 arg6,
ObjectGuid::LowType counter) {
return ObjectGuidFactory::CreateLFGObject(arg1, arg2, arg3, arg4, arg5, arg6, counter); }
387 std::array<uint64, 2> _data = { };
409 void HandleCounterOverflow();
410 void CheckGuidTrigger();
426 return key.GetHash();
453 switch (legacyTypeID)
486 if (legacyTypeMask & (1 <<
uint32(i)))
std::list< ObjectGuid > GuidList
std::unordered_set< ObjectGuid > GuidUnorderedSet
@ TYPEID_AZERITE_EMPOWERED_ITEM
TC_GAME_API ByteBuffer & operator>>(ByteBuffer &buf, ObjectGuid &guid)
std::set< ObjectGuid > GuidSet
#define MAKE_GUID_TRAIT(high, sequence, format)
DEFINE_ENUM_FLAG(ObjectGuidSequenceSource)
@ TYPEMASK_AZERITE_EMPOWERED_ITEM
TC_GAME_API ByteBuffer & operator<<(ByteBuffer &buf, ObjectGuid const &guid)
std::vector< ObjectGuid > GuidVector
static ObjectGuid CreateTransport(HighGuid type, uint32 counter)
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 CreateGuild(HighGuid type, uint32 realmId, uint64 dbId)
static ObjectGuid CreateUniq(uint64 id)
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 ObjectGuid CreatePlayer(uint32 realmId, uint64 dbId)
static ObjectGuid CreateNull()
static ObjectGuid CreateLFGList(uint8 arg1, uint64 counter)
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)
ObjectGuidGenerator(HighGuid high, ObjectGuid::LowType start=UI64LIT(1))
ObjectGuid::LowType _nextGuid
ObjectGuid::LowType GetNextAfterMaxUsed() const
~ObjectGuidGenerator()=default
void Set(ObjectGuid::LowType val)
static LowType GetMaxCounter(HighGuid high)
LowType GetCounter() const
static ObjectGuid const Empty
bool IsAnyTypeGameObject() const
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Client, ObjectGuid > Create(uint32 arg1, ObjectGuid::LowType counter)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldObject, ObjectGuid > Create(uint16 mapId, uint32 entry, ObjectGuid::LowType counter)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Uniq, ObjectGuid > Create(ObjectGuid::LowType id)
ObjectGuid(uint64 high, uint64 low)
bool IsAreaTrigger() const
uint64 GetRawValue(std::size_t i) const
void SetRawValue(uint64 high, uint64 low)
bool operator==(ObjectGuid const &right) const =default
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ChatChannel, ObjectGuid > Create(bool builtIn, bool trade, uint16 zoneId, uint8 factionGroupMask, ObjectGuid::LowType counter)
bool IsSceneObject() const
static ObjectGuid const FromStringFailed
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LFGObject, ObjectGuid > Create(uint8 arg1, uint8 arg2, uint8 arg3, uint8 arg4, bool arg5, uint8 arg6, ObjectGuid::LowType counter)
bool IsMOTransport() const
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldLayer, ObjectGuid > Create(uint32 arg1, uint16 arg2, uint8 arg3, uint32 arg4)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ToolsClient, ObjectGuid > Create(uint16 mapId, uint32 serverId, ObjectGuid::LowType counter)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LFGList, ObjectGuid > Create(uint8 arg1, ObjectGuid::LowType counter)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Transport, ObjectGuid > Create(uint32 counter)
bool IsDynamicObject() const
LowType GetMaxCounter() const
bool IsGameObject() const
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldObject, ObjectGuid > Create(uint8 subType, uint16 mapId, uint32 entry, ObjectGuid::LowType counter)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Item, ObjectGuid > Create(ObjectGuid::LowType dbId)
bool IsCreatureOrPet() const
std::strong_ordering operator<=>(ObjectGuid const &right) const
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::MobileSession, ObjectGuid > Create(uint16 arg1, ObjectGuid::LowType counter)
std::array< uint64, 2 > _data
static ObjectGuid const TradeItem
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Player, ObjectGuid > Create(ObjectGuid::LowType dbId)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LMMLobby, ObjectGuid > Create(uint32 arg2, uint8 arg3, uint8 arg4, ObjectGuid::LowType counter)
uint32 GetSubType() const
char const * GetTypeName() const
bool IsAnyTypeCreature() const
bool IsCreatureOrVehicle() const
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ClientActor, ObjectGuid > Create(uint16 ownerType, uint16 ownerId, uint32 counter)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Guild, ObjectGuid > Create(ObjectGuid::LowType dbId)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ClubFinder, ObjectGuid > Create(uint8 clubType, uint32 clubFinderId, ObjectGuid::LowType dbId)
uint32 GetRealmId() const
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Null, ObjectGuid > Create()
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Global, ObjectGuid > Create(ObjectGuid::LowType dbId)
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WebObj, ObjectGuid > Create(uint8 arg1, uint8 arg2, ObjectGuid::LowType counter)
bool IsConversation() const
TC_COMMON_API char const * GetHash()
TC_COMMON_API std::string GetTypeName(std::type_info const &)
constexpr TypeMask ConvertLegacyTypeMask(uint32 legacyTypeMask)
constexpr ::TypeID ConvertLegacyTypeID(TypeID legacyTypeID)
std::string ToString(Type &&val, Params &&... params)
constexpr bool is_neq(std::partial_ordering cmp) noexcept
std::integral_constant< ObjectGuidFormatType, ObjectGuidFormatType::Null > Format
static constexpr EnumFlag< ObjectGuidSequenceSource > SequenceSource
size_t operator()(ObjectGuid const &key) const noexcept