LeviLamina
Loading...
Searching...
No Matches
TradeContainerManagerController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/containers/ContainerEnumName.h"
7#include "mc/world/containers/SlotData.h"
8#include "mc/world/containers/controllers/ItemTakeType.h"
9#include "mc/world/containers/managers/controllers/ContainerManagerController.h"
10#include "mc/world/item/ItemInstance.h"
11
12// auto generated forward declare list
13// clang-format off
14class ItemStack;
15class ItemStackBase;
16class MerchantRecipe;
18struct AutoPlaceItem;
19struct AutoPlaceResult;
23struct SelectedSlotInfo;
24// clang-format on
25
26class TradeContainerManagerController : public ::ContainerManagerController {
27public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::TradeContainerManagerModel>> mTradeContainerMangerModel;
31 ::ll::TypedStorage<4, 4, int> mCurrentRecipeIndex;
32 ::ll::TypedStorage<8, 40, ::SlotData const> mCreatedItemOutputSlot;
33 ::ll::TypedStorage<8, 128, ::ItemInstance> mResultPreviewItem;
34 ::ll::TypedStorage<8, 8, ::MerchantRecipe*> mResultPreviewRecipe;
35 // NOLINTEND
36
37#ifdef LL_PLAT_S
38#else // LL_PLAT_C
39public:
40 // prevent constructor by default
41 TradeContainerManagerController();
42
43#endif
44public:
45 // virtual functions
46 // NOLINTBEGIN
47#ifdef LL_PLAT_S
48 virtual ~TradeContainerManagerController() /*override*/ = default;
49#else // LL_PLAT_C
50 virtual ~TradeContainerManagerController() /*override*/;
51#endif
52
53#ifdef LL_PLAT_S
54 virtual bool isOutputSlot(::std::string const&) const /*override*/;
55#else // LL_PLAT_C
56 virtual bool isOutputSlot(::std::string const& collectionName) const /*override*/;
57#endif
58
59#ifdef LL_PLAT_S
60 virtual ::ItemStackBase const& getTakeableItemStackBase(::SlotData const&) const /*override*/;
61#else // LL_PLAT_C
62 virtual ::ItemStackBase const& getTakeableItemStackBase(::SlotData const& slot) const /*override*/;
63#endif
64
65#ifdef LL_PLAT_S
66 virtual void handleTakeAll(::SlotData const&, ::SlotData const&) /*override*/;
67#else // LL_PLAT_C
68 virtual void handleTakeAll(::SlotData const& dstSlot, ::SlotData const& srcSlot) /*override*/;
69#endif
70
71#ifdef LL_PLAT_S
72 virtual void handleTakeAmount(::SlotData const&, int, ::SlotData const&) /*override*/;
73#else // LL_PLAT_C
74 virtual void handleTakeAmount(::SlotData const& dstSlot, int amount, ::SlotData const& srcSlot) /*override*/;
75#endif
76
77#ifdef LL_PLAT_S
78 virtual void handleTakeHalf(::SlotData const&, ::SlotData const&) /*override*/;
79#else // LL_PLAT_C
80 virtual void handleTakeHalf(::SlotData const& dstSlot, ::SlotData const& srcSlot) /*override*/;
81#endif
82
83#ifdef LL_PLAT_S
84 virtual int handleAutoPlace(
85 ::SlotData const&,
86 int,
87 ::std::vector<::AutoPlaceItem> const&,
88 ::std::vector<::AutoPlaceResult>&
89 ) /*override*/;
90#else // LL_PLAT_C
91 virtual int handleAutoPlace(
92 ::SlotData const& srcSlot,
93 int amount,
94 ::std::vector<::AutoPlaceItem> const& autoPlaceOrder,
95 ::std::vector<::AutoPlaceResult>& destinations
96 ) /*override*/;
97#endif
98
99#ifdef LL_PLAT_S
100 virtual void handlePlaceAll(::SelectedSlotInfo const&, ::SlotData const&) /*override*/;
101#else // LL_PLAT_C
102 virtual void handlePlaceAll(::SelectedSlotInfo const& selected, ::SlotData const& dstSlot) /*override*/;
103#endif
104
105#ifdef LL_PLAT_S
106 virtual void handlePlaceOne(::SlotData const&, ::SlotData const&) /*override*/;
107#else // LL_PLAT_C
108 virtual void handlePlaceOne(::SlotData const& srcSlot, ::SlotData const& dstSlot) /*override*/;
109#endif
110
111#ifdef LL_PLAT_S
112 virtual void handleAddToStack(::SlotData const&, ::SlotData const&, ::ItemTakeType) /*override*/;
113#else // LL_PLAT_C
114 virtual void
115 handleAddToStack(::SlotData const& dstSlot, ::SlotData const& srcSlot, ::ItemTakeType type) /*override*/;
116#endif
117
118#ifdef LL_PLAT_S
119 virtual ::CreateContainerItemScope
120 _makeCreateItemScope(::SlotData const&, ::ItemTransferAmount const&) /*override*/;
121#else // LL_PLAT_C
122 virtual ::CreateContainerItemScope
123 _makeCreateItemScope(::SlotData const& srcSlot, ::ItemTransferAmount const& takeAmount) /*override*/;
124#endif
125
126 // NOLINTEND
127
128public:
129 // member functions
130 // NOLINTBEGIN
131#ifdef LL_PLAT_C
132 MCNAPI explicit TradeContainerManagerController(::std::weak_ptr<::TradeContainerManagerModel> pModel);
133
134 MCNAPI void _consumeIngredients(uchar numCrafts);
135
136 MCNAPI void
137 _consumeMaterials(::ItemStack const& containerItem, int amount, ::ContainerEnumName inputContainerEnumName);
138
139 MCNAPI void _createResult(bool shouldPlayAudio);
140
141 MCNAPI void
142 _createTradeItem(::ItemInstance& itemInstance, ::ItemStackRequestScope const& requestScope, uchar numCrafts);
143
144 MCNAPI ::MerchantRecipe* _getActiveRecipe();
145
146 MCNAPI bool _handleTransferTrade(::SlotData const& srcSlot, ::SlotData const& dstSlot);
147
148 MCNAPI void _moveItemsBackToInventory();
149
150 MCNAPI void _setupCallbacks();
151
152 MCNAPI int getAvailableRecipeListSize();
153
154 MCNAPI ::std::string getDisplayName();
155
156 MCNAPI ::MerchantRecipe* getRecipe(int CurrentIndex);
157
158 MCNAPI void recipeChanged();
159
160 MCNAPI void setRecipeIndex(int index);
161#endif
162 // NOLINTEND
163
164public:
165 // constructor thunks
166 // NOLINTBEGIN
167#ifdef LL_PLAT_C
168 MCNAPI void* $ctor(::std::weak_ptr<::TradeContainerManagerModel> pModel);
169#endif
170 // NOLINTEND
171
172public:
173 // destructor thunk
174 // NOLINTBEGIN
175 MCNAPI void $dtor();
176 // NOLINTEND
177
178public:
179 // virtual function thunks
180 // NOLINTBEGIN
181#ifdef LL_PLAT_C
182 MCNAPI bool $isOutputSlot(::std::string const& collectionName) const;
183
184 MCNAPI ::ItemStackBase const& $getTakeableItemStackBase(::SlotData const& slot) const;
185
186 MCNAPI void $handleTakeAll(::SlotData const& dstSlot, ::SlotData const& srcSlot);
187
188 MCNAPI void $handleTakeAmount(::SlotData const& dstSlot, int amount, ::SlotData const& srcSlot);
189
190 MCNAPI void $handleTakeHalf(::SlotData const& dstSlot, ::SlotData const& srcSlot);
191
192 MCNAPI int $handleAutoPlace(
193 ::SlotData const& srcSlot,
194 int amount,
195 ::std::vector<::AutoPlaceItem> const& autoPlaceOrder,
196 ::std::vector<::AutoPlaceResult>& destinations
197 );
198
199 MCNAPI void $handlePlaceAll(::SelectedSlotInfo const& selected, ::SlotData const& dstSlot);
200
201 MCNAPI void $handlePlaceOne(::SlotData const& srcSlot, ::SlotData const& dstSlot);
202
203 MCNAPI void $handleAddToStack(::SlotData const& dstSlot, ::SlotData const& srcSlot, ::ItemTakeType type);
204
205 MCNAPI ::CreateContainerItemScope
206 $_makeCreateItemScope(::SlotData const& srcSlot, ::ItemTransferAmount const& takeAmount);
207#endif
208
209
210 // NOLINTEND
211
212public:
213 // vftables
214 // NOLINTBEGIN
215 MCNAPI static void** $vftable();
216 // NOLINTEND
217};
Definition ItemInstance.h:15
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition MerchantRecipe.h:20
static MCAPI void ** $vftable()
Definition TradeContainerManagerModel.h:19
Definition AutoPlaceItem.h:5
Definition AutoPlaceResult.h:5
Definition CreateContainerItemScope.h:18
Definition ItemStackRequestScope.h:16
Definition ItemTransferAmount.h:9
Definition SelectedSlotInfo.h:10
Definition SlotData.h:10