LeviLamina
Loading...
Searching...
No Matches
ContainerScreenValidation.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/containers/FullContainerName.h"
7#include "mc/world/inventory/network/ContainerScreenContext.h"
8#include "mc/world/inventory/simulation/ContainerScreenRequestActionType.h"
9#include "mc/world/inventory/simulation/ContainerValidationCaller.h"
10#include "mc/world/inventory/simulation/ContainerValidationDebug.h"
11
12// auto generated forward declare list
13// clang-format off
14class Container;
17class ItemStack;
25// clang-format on
26
27class ContainerScreenValidation {
28public:
29 // member variables
30 // NOLINTBEGIN
31 ::ll::TypedStorage<8, 40, ::ContainerScreenContext> mScreenContext;
32 ::ll::TypedStorage<4, 4, ::ContainerValidationCaller> mCaller;
33 ::ll::TypedStorage<8, 64, ::std::unordered_map<::FullContainerName, uint64>> mContainerIndexMap;
34 ::ll::TypedStorage<
35 8,
36 64,
37 ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::ContainerValidationBase const>>>
38 mContainerValidatorMap;
39 ::ll::TypedStorage<8, 64, ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>>>
40 mPredictiveContainers;
41 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ContainerScreenValidatorBase>> mContainerScreenValidator;
42 ::ll::TypedStorage<8, 24, ::std::vector<::ContainerValidationLayer>> mValidationStack;
43 ::ll::TypedStorage<4, 12, ::ContainerValidationDebug const> mDebug;
44 // NOLINTEND
45
46public:
47 // prevent constructor by default
48 ContainerScreenValidation();
49
50public:
51 // virtual functions
52 // NOLINTBEGIN
53 virtual ~ContainerScreenValidation();
54
55 virtual ::ContainerValidationResult
56 tryCraft(::std::unique_ptr<::ContainerValidationCraftInputs> craftInputs, uchar const numCrafts);
57
58 virtual ::ContainerValidationCraftResult
59 getCraftResults(::std::unique_ptr<::ContainerValidationCraftInputs> craftInputs, uchar const numCrafts);
60
61 virtual ::ContainerValidationResult tryActivate();
62 // NOLINTEND
63
64public:
65 // member functions
66 // NOLINTBEGIN
67 MCAPI ContainerScreenValidation(
68 ::ContainerScreenContext const& screenContext,
69 ::ContainerValidationCaller caller,
70 ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>> predictiveContainers
71 );
72
73 MCAPI void _commit();
74
75 MCAPI ::ContainerValidationSlotInfo
76 _createContainerValidatorSlotInfo(::ContainerValidationSlotData const& slotData);
77
78 MCAPI bool _dropItems();
79
80 MCAPI ::std::shared_ptr<::ContainerValidationBase const>
81 _getOrCreateContainerValidator(::FullContainerName const& containerEnumName);
82
83 MCAPI bool _propagateContainers();
84
85 MCAPI int _tryAddItem(::ContainerValidationSlotInfo& slotInfo, int addCount, bool allowPartialSuccess);
86
87 MCAPI bool
88 _tryMoveItem(::ContainerValidationSlotInfo& srcValidatorPair, ::ContainerValidationSlotInfo& dstValidatorPair);
89
90 MCAPI ::ItemStack _tryRemoveItem(::ContainerValidationSlotInfo& slotInfo, int amount);
91
92 MCAPI int _trySetItem(
94 ::ItemStack const& stack,
95 bool isWholeStackTransfer,
96 bool allowPartialSuccess,
97 bool isInternalTransfer
98 );
99
100 MCAPI ::ContainerValidationResult _tryTransferSpecial(
101 ::ContainerValidationSlotData const& srcSlotData,
102 int transferAmount,
103 ::ContainerScreenRequestActionType actionType
104 );
105
106 MCAPI ::std::shared_ptr<::SimpleSparseContainer>
107 getOrCreateSparseContainer(::FullContainerName const& containerEnumName);
108
109 MCAPI bool tryCommitActionResults();
110
111 MCAPI ::ContainerValidationResult tryConsume(::ContainerValidationSlotData const& srcSlotData, int transferAmount);
112
113 MCAPI ::ContainerValidationResult
114 tryDrop(::ContainerValidationSlotData const& srcSlotData, int transferAmount, bool dropRandomly);
115
116 MCAPI ::ContainerValidationResult
117 trySwap(::ContainerValidationSlotData const& srcSlotData, ::ContainerValidationSlotData const& dstSlotData);
118
119 MCAPI ::ContainerValidationResult tryTransfer(
120 ::ContainerValidationSlotData const& srcSlotData,
121 ::ContainerValidationSlotData const& dstSlotData,
122 int transferAmount,
123 bool isAllowingPartialTransfer
124 );
125 // NOLINTEND
126
127public:
128 // static functions
129 // NOLINTBEGIN
130 MCAPI static ::std::unique_ptr<::ContainerScreenValidation> makeContainerScreenValidation(
131 ::ContainerScreenContext const& screenContext,
132 ::ContainerValidationCaller caller,
133 ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>> predictiveContainers
134 );
135 // NOLINTEND
136
137public:
138 // constructor thunks
139 // NOLINTBEGIN
140 MCAPI void* $ctor(
141 ::ContainerScreenContext const& screenContext,
142 ::ContainerValidationCaller caller,
143 ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>> predictiveContainers
144 );
145 // NOLINTEND
146
147public:
148 // destructor thunk
149 // NOLINTBEGIN
150 MCAPI void $dtor();
151 // NOLINTEND
152
153public:
154 // virtual function thunks
155 // NOLINTBEGIN
156 MCAPI ::ContainerValidationResult
157 $tryCraft(::std::unique_ptr<::ContainerValidationCraftInputs> craftInputs, uchar const numCrafts);
158
159 MCAPI ::ContainerValidationCraftResult
160 $getCraftResults(::std::unique_ptr<::ContainerValidationCraftInputs> craftInputs, uchar const numCrafts);
161
162 MCFOLD ::ContainerValidationResult $tryActivate();
163
164
165 // NOLINTEND
166
167public:
168 // vftables
169 // NOLINTBEGIN
170 MCNAPI static void** $vftable();
171 // NOLINTEND
172};
Definition ContainerScreenContext.h:17
static MCAPI void ** $vftable()
Definition ContainerScreenValidatorBase.h:18
Definition ContainerValidationBase.h:12
Definition Container.h:33
Definition ItemStack.h:26
Definition SimpleSparseContainer.h:18
Definition ContainerValidationCraftInputs.h:5
Definition ContainerValidationCraftResult.h:14
Definition ContainerValidationLayer.h:15
Definition ContainerValidationResult.h:14
Definition ContainerValidationSlotData.h:8
Definition ContainerValidationSlotInfo.h:14
Definition FullContainerName.h:8