LeviLamina
Loading...
Searching...
No Matches
InventorySource.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/ContainerID.h"
7#include "mc/world/inventory/transaction/InventorySourceType.h"
8
10public:
11 // InventorySource inner types define
12 enum class InventorySourceFlags : uint {
13 NoFlag = 0,
14 WorldInteractionRandom = 1,
15 };
16
17public:
18 // member variables
19 // NOLINTBEGIN
20 ::ll::TypedStorage<4, 4, ::InventorySourceType> mType;
21 ::ll::TypedStorage<1, 1, ::ContainerID> mContainerId;
22 ::ll::TypedStorage<4, 4, ::InventorySource::InventorySourceFlags> mFlags;
23 // NOLINTEND
24
25public:
26 bool operator==(InventorySource const& other) const {
27 if (this->mType != other.mType) {
28 return false;
29 }
30 if (this->mType == InventorySourceType::GlobalInventory) {
31 return true;
32 }
33 if (this->mType != InventorySourceType::ContainerInventory) {
34 return false;
35 }
36 return this->mContainerId == other.mContainerId;
37 }
38};
39
40namespace std {
41template <>
42struct hash<InventorySource> {
43 size_t operator()(InventorySource const& source) const noexcept {
44 return static_cast<int64>(source.mContainerId) ^ (static_cast<uint>(source.mType) << 16);
45 }
46};
47} // namespace std
Definition InventorySource.h:9
STL namespace.