18#ifndef TRINITYCORE_OBJECT_GUID_H
19#define TRINITYCORE_OBJECT_GUID_H
30#include <unordered_set>
45#define NUM_CLIENT_OBJECT_TYPES 8
94template<HighGu
id high>
98 using Format = std::integral_constant<ObjectGuidFormatType, ObjectGuidFormatType::OnlyCounter>;
101#define MAKE_GUID_TRAIT(high, sequence, format) \
102 template<> struct ObjectGuidTraits<high> \
104 static constexpr EnumFlag<ObjectGuidSequenceSource> SequenceSource = sequence; \
105 using Format = std::integral_constant<ObjectGuidFormatType, format>; \
165 return HasEntry(high)
180 bool IsUnit()
const {
return IsAnyTypeCreature() || IsPlayer(); }
218 static std::string_view GetTypeName(
HighGuid high);
220 std::string ToString()
const;
221 std::string ToHexString()
const;
266#define PACKED_GUID_MIN_BUFFER_SIZE 9
278 std::size_t
size()
const {
return _packedSize; }
296 void HandleCounterOverflow();
297 void CheckGuidTrigger();
314 return std::hash<uint64>()(key.GetRawValue());
321 template <
typename FormatContext>
#define DEFINE_ENUM_FLAG(enumType)
ByteBuffer & operator<<(ByteBuffer &buf, ObjectGuid const &guid)
std::list< ObjectGuid > GuidList
std::unordered_set< ObjectGuid > GuidUnorderedSet
TC_GAME_API ByteBuffer & operator>>(ByteBuffer &buf, ObjectGuid &guid)
std::set< ObjectGuid > GuidSet
#define MAKE_GUID_TRAIT(high, sequence, format)
TC_GAME_API ByteBuffer & operator<<(ByteBuffer &buf, ObjectGuid const &guid)
std::vector< ObjectGuid > GuidVector
ObjectGuid::LowType _nextGuid
ObjectGuid::LowType GetNextAfterMaxUsed() const
~ObjectGuidGenerator()=default
void Set(ObjectGuid::LowType val)
ObjectGuidGenerator(HighGuid high, ObjectGuid::LowType start=1)
static constexpr ObjectGuid Create(uint32 entry, LowType counter)
static LowType GetMaxCounter(HighGuid high)
LowType GetCounter() const
static ObjectGuid const Empty
static constexpr bool HasEntry(HighGuid high)
bool IsAnyTypeGameObject() const
bool operator==(ObjectGuid const &right) const =default
void SetRawValue(uint64 guid)
static constexpr ObjectGuid Create(LowType counter)
bool IsMOTransport() const
uint64 GetRawValue() const
PackedGuidWriter WriteAsPacked() const
std::string_view GetTypeName() const
bool IsDynamicObject() const
LowType GetMaxCounter() const
bool IsGameObject() const
bool IsCreatureOrPet() const
static TypeID GetTypeId(HighGuid high)
bool IsAnyTypeCreature() const
bool IsCreatureOrVehicle() const
PackedGuidReader ReadAsPacked()
std::strong_ordering operator<=>(ObjectGuid const &right) const =default
constexpr ObjectGuid()=default
std::array< uint8, PACKED_GUID_MIN_BUFFER_SIZE > _packedGuid
PackedGuid(ObjectGuid guid)
std::integral_constant< ObjectGuidFormatType, ObjectGuidFormatType::OnlyCounter > Format
static constexpr EnumFlag< ObjectGuidSequenceSource > SequenceSource
PackedGuidReader(ObjectGuid &guid)
PackedGuidWriter(ObjectGuid const &guid)
size_t operator()(ObjectGuid const &key) const noexcept