LeviLamina
Loading...
Searching...
No Matches
ActorUniqueID.h
1
#pragma once
2
3
#include "mc/_HeaderOutputPredefine.h"
4
5
struct
ActorUniqueID
{
6
public
:
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
13
public
:
14
// member variables
15
// NOLINTBEGIN
16
int64 rawID;
17
// NOLINTEND
18
19
public
:
20
// member functions
21
// NOLINTBEGIN
22
MCAPI uint64 getHash()
const
;
23
// NOLINTEND
24
25
public
:
26
// static variables
27
// NOLINTBEGIN
28
MCAPI static ::ActorUniqueID
const
& INVALID_ID();
29
// NOLINTEND
30
};
31
32
namespace
std
{
33
template
<>
34
struct
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
std
STL namespace.
ActorUniqueID
Definition
ActorUniqueID.h:5
src
mc
legacy
ActorUniqueID.h
Generated on
for LeviLamina by
1.16.1