Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BaseContainerMenu.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/pub_sub/Publisher.h"
7#include "mc/deps/shared_types/legacy/ContainerType.h"
8#include "mc/world/ContainerContentChangeListener.h"
9#include "mc/world/ContainerID.h"
10#include "mc/world/containers/managers/IContainerManager.h"
11
12// auto generated forward declare list
13// clang-format off
14class Container;
16class ItemStack;
17class Player;
19namespace Bedrock::PubSub { class Subscription; }
20namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
21// clang-format on
22
23class BaseContainerMenu : public ::ContainerContentChangeListener, public ::IContainerManager {
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
28 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mLastSlots;
29 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerContainerRefresher>> mContainerRefresher;
30 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::DynamicContainerTracker>> mDynamicContainerTracker;
31 ::ll::TypedStorage<1, 1, ::ContainerID> mContainerId;
32 ::ll::TypedStorage<1, 1, ::SharedTypes::Legacy::ContainerType> mContainerType;
33 ::ll::TypedStorage<4, 4, int> mTicksSinceLastCleanup;
34 ::ll::TypedStorage<
35 8,
36 8,
37 ::std::unique_ptr<::Bedrock::PubSub::Publisher<
38 void(::SharedTypes::Legacy::ContainerType),
40 0>>>
41 mContainerTypeSubscribers;
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
46 BaseContainerMenu& operator=(BaseContainerMenu const&);
47 BaseContainerMenu(BaseContainerMenu const&);
48 BaseContainerMenu();
49
50public:
51 // virtual functions
52 // NOLINTBEGIN
53 virtual ~BaseContainerMenu() /*override*/;
54
55 virtual void removeSlot(int slot, int count) = 0;
56
57 virtual bool isSlotDirty(int slot);
58
59 virtual bool isResultSlot(int slot);
60
61 virtual void containerContentChanged(int slot) /*override*/;
62
63 virtual void serverInitItemStackIds() = 0;
64
65 virtual ::std::vector<::ItemStack> getItemCopies() const = 0;
66
67 virtual void setSlot(int, ::ItemStack const&, bool) = 0;
68
69 virtual ::ItemStack const& getSlot(int slot) const = 0;
70
71 virtual void setData(int, int) /*override*/;
72
73 virtual void setSelectedRecipeIndex(int, bool) /*override*/;
74
75 virtual ::std::optional<int> getSelectedRecipeIndex() const /*override*/;
76
77 virtual ::ContainerID getContainerId() const /*override*/;
78
79 virtual void setContainerId(::ContainerID id) /*override*/;
80
81 virtual ::SharedTypes::Legacy::ContainerType getContainerType() const /*override*/;
82
83 virtual void setContainerType(::SharedTypes::Legacy::ContainerType type) /*override*/;
84
85 virtual ::Bedrock::PubSub::Subscription
86 registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const
87 /*override*/;
88
89 virtual void broadcastChanges() /*override*/;
90
91 virtual ::Container* _getContainer() const = 0;
92 // NOLINTEND
93
94public:
95 // destructor thunk
96 // NOLINTBEGIN
97 MCNAPI void $dtor();
98 // NOLINTEND
99
100public:
101 // virtual function thunks
102 // NOLINTBEGIN
103 MCNAPI bool $isSlotDirty(int slot);
104
105 MCNAPI bool $isResultSlot(int slot);
106
107 MCNAPI void $containerContentChanged(int slot);
108
109 MCNAPI void $setData(int, int);
110
111 MCNAPI void $setSelectedRecipeIndex(int, bool);
112
113 MCNAPI ::std::optional<int> $getSelectedRecipeIndex() const;
114
115 MCNAPI ::ContainerID $getContainerId() const;
116
117 MCNAPI void $setContainerId(::ContainerID id);
118
119 MCNAPI ::SharedTypes::Legacy::ContainerType $getContainerType() const;
120
121 MCNAPI void $setContainerType(::SharedTypes::Legacy::ContainerType type);
122
123 MCNAPI ::Bedrock::PubSub::Subscription
124 $registerContainerTypeListener(::std::function<void(::SharedTypes::Legacy::ContainerType)> callback) const;
125
126 MCNAPI void $broadcastChanges();
127
128
129 // NOLINTEND
130};
MCAPI void $setContainerType(::SharedTypes::Legacy::ContainerType type)
MCAPI void $setData(int, int)
MCAPI void $broadcastChanges()
MCAPI bool $isSlotDirty(int slot)
MCAPI void $containerContentChanged(int slot)
MCAPI ::std::optional< int > $getSelectedRecipeIndex() const
MCAPI bool $isResultSlot(int slot)
MCAPI::Bedrock::PubSub::Subscription $registerContainerTypeListener(::std::function< void(::SharedTypes::Legacy::ContainerType)> callback) const
MCAPI void $setSelectedRecipeIndex(int, bool)
MCAPI::SharedTypes::Legacy::ContainerType $getContainerType() const
MCAPI void $setContainerId(::ContainerID id)
MCAPI::ContainerID $getContainerId() const
MCAPI void $dtor()
Definition Publisher.h:25
Definition Subscription.h:10
Definition ContainerContentChangeListener.h:5
Definition Container.h:36
Definition DynamicContainerTracker.h:20
Definition IContainerManager.h:16
Definition ItemStack.h:26
Definition Player.h:131
Definition PlayerContainerRefresher.h:13