LeviLamina
Loading...
Searching...
No Matches
ItemStackNetManagerBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/game_refs/OwnerPtr.h"
7#include "mc/deps/game_refs/WeakRef.h"
8#include "mc/deps/shared_types/legacy/ContainerType.h"
9#include "mc/world/inventory/network/TypedClientNetId.h"
10
11// auto generated forward declare list
12// clang-format off
13class BlockSource;
16class EntityRegistry;
17class ItemStack;
21class Player;
22class SparseContainer;
26// clang-format on
27
28class ItemStackNetManagerBase {
29public:
30 // ItemStackNetManagerBase inner types define
31 using BaseContainerSetter = ::std::function<void(::ItemStack const&)>;
32
33 using LegacyRequestScope = ::gsl::final_action<::std::function<void()>>;
34
35public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<1, 1, bool const> mIsEnabled;
39 ::ll::TypedStorage<1, 1, bool const> mIsClientSide;
40 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
41 ::ll::TypedStorage<8, 16, ::WeakRef<::EntityRegistry>> mLevelWeakRegistry;
42 ::ll::TypedStorage<8, 16, ::OwnerPtr<::EntityRegistry>> mEntityRegistry;
43 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackNetManagerScreenStack>> mScreenStack;
44 ::ll::TypedStorage<1, 1, bool> mCurrentRequestHasCraftAction;
45 ::ll::TypedStorage<8, 16, ::ItemStackLegacyRequestId> mLegacyTransactionRequestId;
46 // NOLINTEND
47
48public:
49 // prevent constructor by default
50 ItemStackNetManagerBase& operator=(ItemStackNetManagerBase const&);
51 ItemStackNetManagerBase(ItemStackNetManagerBase const&);
52 ItemStackNetManagerBase();
53
54public:
55 // virtual functions
56 // NOLINTBEGIN
57 virtual ~ItemStackNetManagerBase();
58
59 virtual bool isEnabled() const;
60
61 virtual ::ItemStackRequestId getRequestId() const = 0;
62
63 virtual bool retainSetItemStackNetIdVariant() const;
64
65 virtual bool allowInventoryTransactionManager() const = 0;
66
67 virtual ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest();
68
69 virtual void onContainerScreenOpen(::ContainerScreenContext const& screenContext);
70
71 virtual void onContainerScreenClose();
72
73 virtual ::SparseContainer* initOpenContainer(
74 ::BlockSource& region,
75 ::FullContainerName const& openContainerId,
76 ::ContainerWeakRef const& containerWeakRef
77 );
78
79 virtual void _addLegacyTransactionRequestSetItemSlot(
81 ::SharedTypes::Legacy::ContainerType containerType,
82 int slot
83 );
84
85 virtual void _initScreen(::ItemStackNetManagerScreen& screen);
86 // NOLINTEND
87
88public:
89 // member functions
90 // NOLINTBEGIN
91 MCAPI ItemStackNetManagerBase(::Player& player, bool isClientSide, bool isEnabled);
92
93 MCAPI bool _isRequestActionAllowed(::ItemStackRequestAction const& requestAction);
94
95 MCAPI void _pushScreen(::ContainerScreenContext screenContext);
96
97 MCAPI ::ContainerScreenContext const& getScreenContext() const;
98
99 MCFOLD bool isClientSide() const;
100
101 MCAPI bool isScreenOpen() const;
102 // NOLINTEND
103
104public:
105 // static functions
106 // NOLINTBEGIN
107 MCAPI static ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest(::Player* player);
108
109 MCAPI static bool setPlayerContainer(
110 ::Player& player,
111 ::SharedTypes::Legacy::ContainerType containerType,
112 int slot,
113 ::ItemStack const& item,
114 ::ItemStack& slotItem,
115 ::std::function<void(::ItemStack const&)> const& callback
116 );
117 // NOLINTEND
118
119public:
120 // constructor thunks
121 // NOLINTBEGIN
122 MCAPI void* $ctor(::Player& player, bool isClientSide, bool isEnabled);
123 // NOLINTEND
124
125public:
126 // destructor thunk
127 // NOLINTBEGIN
128 MCAPI void $dtor();
129 // NOLINTEND
130
131public:
132 // virtual function thunks
133 // NOLINTBEGIN
134 MCFOLD bool $isEnabled() const;
135
136 MCFOLD bool $retainSetItemStackNetIdVariant() const;
137
138 MCAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
139
140 MCAPI void $onContainerScreenOpen(::ContainerScreenContext const& screenContext);
141
142 MCAPI void $onContainerScreenClose();
143
144 MCFOLD ::SparseContainer* $initOpenContainer(
145 ::BlockSource& region,
146 ::FullContainerName const& openContainerId,
147 ::ContainerWeakRef const& containerWeakRef
148 );
149
150 MCFOLD void $_addLegacyTransactionRequestSetItemSlot(
152 ::SharedTypes::Legacy::ContainerType containerType,
153 int slot
154 );
155
156 MCFOLD void $_initScreen(::ItemStackNetManagerScreen& screen);
157
158
159 // NOLINTEND
160
161public:
162 // vftables
163 // NOLINTBEGIN
164 MCNAPI static void** $vftable();
165 // NOLINTEND
166};
Definition BlockSource.h:72
Definition ContainerScreenContext.h:19
Definition ContainerWeakRef.h:20
Definition EntityRegistry.h:11
static MCAPI void ** $vftable()
Definition ItemStackNetManagerScreenStack.h:10
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestAction.h:18
Definition ItemStack.h:35
Definition Player.h:136
Definition SparseContainer.h:24
Definition FullContainerName.h:8
Definition ItemStackLegacyRequestIdTag.h:5
Definition ItemStackRequestIdTag.h:5