LeviLamina
Loading...
Searching...
No Matches
ActorUniqueID.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
6public:
7 [[nodiscard]] constexpr bool operator==(ActorUniqueID const& other) const noexcept { return rawID == other.rawID; }
8
9 [[nodiscard]] constexpr std::strong_ordering operator<=>(ActorUniqueID const& other) const noexcept {
10 return rawID <=> other.rawID;
11 }
12
13public:
14 // member variables
15 // NOLINTBEGIN
16 int64 rawID;
17 // NOLINTEND
18
19public:
20 // member functions
21 // NOLINTBEGIN
22 MCAPI uint64 getHash() const;
23 // NOLINTEND
24
25public:
26 // static variables
27 // NOLINTBEGIN
28 MCAPI static ::ActorUniqueID const& INVALID_ID();
29 // NOLINTEND
30};
31
32namespace std {
33template <>
34struct hash<ActorUniqueID> {
35 size_t operator()(ActorUniqueID const& id) const noexcept {
36 static std::hash<int64> hasher;
37 size_t seed = 0;
38 seed ^= hasher(id.rawID >> 32) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
39 seed ^= hasher(id.rawID & 0xffffff) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
40 return seed;
41 }
42};
43} // namespace std
STL namespace.
Definition ActorUniqueID.h:5