Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
WorldPackCollectionManagerImpl.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/screens/models/ContentType.h"
7#include "mc/client/services/download/IMarketplacePackDownloader.h"
8#include "mc/client/world/IWorldPackCollectionManager.h"
9#include "mc/client/world/PackAction.h"
10#include "mc/client/world/PackActionError.h"
11#include "mc/client/world/WorldContentItemCollectionsModel.h"
12#include "mc/deps/core/utility/NonOwnerPointer.h"
13#include "mc/deps/core/utility/pub_sub/Publisher.h"
14#include "mc/deps/core/utility/pub_sub/Subscription.h"
15#include "mc/util/PublishedValue.h"
16
17// auto generated forward declare list
18// clang-format off
21class IEntitlementManager;
24struct ContentSource;
25struct PackContentItem;
26struct PackSettingsInfo;
27namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
28namespace ContentItemCollectionViewUtils { struct SelectedReloadProps; }
29namespace World { struct PendingPackAction; }
30// clang-format on
31
32namespace World {
33
34class WorldPackCollectionManagerImpl : public ::World::IWorldPackCollectionManager {
35public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IEntitlementManager>> mEntitlementManager;
39 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const>> mContentTierManager;
40 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IMarketplacePackDownloader>> mMarketplacePackDownloader;
41 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mMarketplacePackDownloaderStatusSub;
42 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ContentSource>> mContentSource;
43 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::MutableContentItemCollection>> mContentItemCollection;
44 ::ll::TypedStorage<8, 48, ::Bedrock::PubSub::Publisher<void(), ::Bedrock::PubSub::ThreadModel::SingleThreaded, 0>>
45 mContentItemCollectionDirtyPublisher;
46 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContentItemCollectionViewUtils::SelectedReloadProps>>
47 mSelectedReloadProps;
48 ::ll::TypedStorage<1, 1, bool> mIsEditorEnabled;
49 ::ll::TypedStorage<8, 96, ::WorldContentItemCollectionsModel> mWorldContentItemCollectionsModel;
50 ::ll::TypedStorage<8, 136, ::PublishedValue<::std::optional<::World::PendingPackAction>>> mPendingPackAction;
51 // NOLINTEND
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 virtual void tick() /*override*/;
57
58 virtual void setContentSource(::std::unique_ptr<::ContentSource>&& contentSource) /*override*/;
59
60 virtual void resetContent() /*override*/;
61
62 virtual void reloadPacks() /*override*/;
63
64 virtual ::Bedrock::PubSub::Subscription
65 subscribeToContentItemCollectionDirtySubscription(::std::function<void()>&& callback) /*override*/;
66
67 virtual ::WorldContentItemCollectionsModel getWorldCollectionsModel() const /*override*/;
68
69 virtual ::std::optional<::World::PackActionError> changePackPriority(
70 ::std::string const& packIdVersion,
71 ::ContentType packType,
72 int fromPosition,
73 int toPosition
74 ) /*override*/;
75
76 virtual ::std::optional<::World::PackActionError>
77 activatePack(::std::string const& packIdVersion, ::ContentType packType, bool ignoreWarnings) /*override*/;
78
79 virtual ::std::optional<::World::PackActionError>
80 deactivatePack(::std::string const& packIdVersion, ::ContentType packType, bool ignoreWarnings) /*override*/;
81
82 virtual ::std::optional<::World::PackActionError> continuePendingPackAction() /*override*/;
83
84 virtual void clearPendingPackAction() /*override*/;
85
86 virtual ::Bedrock::PubSub::Subscription subscribeToPendingPackActionPublisher(
87 ::std::function<void(::std::optional<::World::PendingPackAction>)> callback
88 ) /*override*/;
89
90 virtual ::std::optional<::PackSettingsInfo>
91 getPackSettingsForPackIdVersion(::std::string const& packIdVersion) /*override*/;
92
93 virtual ::std::shared_ptr<::PackContentItem const>
94 getPackItemForPackIdVersion(::std::string_view packIdVersion) /*override*/;
95
96 virtual ::Bedrock::PubSub::Subscription subscribeToMarketplacePackDownloadStatus(
97 ::std::function<void(::IMarketplacePackDownloader::MarketplacePackDownloadStatus)>&& onDownloadStatusChange
98 ) /*override*/;
99
100 virtual void setEditorEnabled(bool isEditorEnabled) /*override*/;
101
102 virtual bool getEditorEnabled() const /*override*/;
103 // NOLINTEND
104
105public:
106 // member functions
107 // NOLINTBEGIN
109
110 MCNAPI ::std::shared_ptr<::ContentItemCollection>
111 _getAvailableContentItemCollection(::ContentType contentType) const;
112
113 MCNAPI ::std::shared_ptr<::ContentItemCollection>
114 _getMarketplacePassContentItemCollection(::ContentType contentType) const;
115
116 MCNAPI ::std::optional<::World::PackActionError> _movePackContent(
117 ::std::string const& packIdVersion,
118 ::ContentType packType,
119 ::World::PackAction packAction,
120 bool ignoreWarnings
121 );
122
124
125 MCNAPI void _reloadContentSource();
126 // NOLINTEND
127
128public:
129 // virtual function thunks
130 // NOLINTBEGIN
131 MCNAPI void $tick();
132
133 MCNAPI void $setContentSource(::std::unique_ptr<::ContentSource>&& contentSource);
134
135 MCNAPI void $resetContent();
136
137 MCNAPI void $reloadPacks();
138
139 MCNAPI ::Bedrock::PubSub::Subscription
141
143
144 MCNAPI ::std::optional<::World::PackActionError>
145 $changePackPriority(::std::string const& packIdVersion, ::ContentType packType, int fromPosition, int toPosition);
146
147 MCNAPI ::std::optional<::World::PackActionError>
148 $activatePack(::std::string const& packIdVersion, ::ContentType packType, bool ignoreWarnings);
149
150 MCNAPI ::std::optional<::World::PackActionError>
151 $deactivatePack(::std::string const& packIdVersion, ::ContentType packType, bool ignoreWarnings);
152
153 MCNAPI ::std::optional<::World::PackActionError> $continuePendingPackAction();
154
156
157 MCNAPI ::Bedrock::PubSub::Subscription
158 $subscribeToPendingPackActionPublisher(::std::function<void(::std::optional<::World::PendingPackAction>)> callback);
159
160 MCNAPI ::std::optional<::PackSettingsInfo> $getPackSettingsForPackIdVersion(::std::string const& packIdVersion);
161
162 MCNAPI ::std::shared_ptr<::PackContentItem const> $getPackItemForPackIdVersion(::std::string_view packIdVersion);
163
164 MCNAPI ::Bedrock::PubSub::Subscription $subscribeToMarketplacePackDownloadStatus(
165 ::std::function<void(::IMarketplacePackDownloader::MarketplacePackDownloadStatus)>&& onDownloadStatusChange
166 );
167
168 MCNAPI void $setEditorEnabled(bool isEditorEnabled);
169
170 MCNAPI bool $getEditorEnabled() const;
171 // NOLINTEND
172};
173
174} // namespace World
Definition ContentItemCollection.h:5
Definition IContentTierManager.h:13
Definition IMarketplacePackDownloader.h:5
Definition MutableContentItemCollection.h:5
Definition WorldPackCollectionManagerImpl.h:7
MCAPI ::std::optional<::PackSettingsInfo > $getPackSettingsForPackIdVersion(::std::string const &packIdVersion)
MCAPI::Bedrock::PubSub::Subscription $subscribeToMarketplacePackDownloadStatus(::std::function< void(::IMarketplacePackDownloader::MarketplacePackDownloadStatus)> &&onDownloadStatusChange)
MCAPI ::std::optional<::World::PackActionError > $deactivatePack(::std::string const &packIdVersion, ::ContentType packType, bool ignoreWarnings)
MCAPI ::std::optional<::World::PackActionError > $changePackPriority(::std::string const &packIdVersion, ::ContentType packType, int fromPosition, int toPosition)
MCAPI::Bedrock::PubSub::Subscription $subscribeToPendingPackActionPublisher(::std::function< void(::std::optional<::World::PendingPackAction >)> callback)
MCAPI::Bedrock::PubSub::Subscription $subscribeToContentItemCollectionDirtySubscription(::std::function< void()> &&callback)
MCAPI ::std::optional<::World::PackActionError > $activatePack(::std::string const &packIdVersion, ::ContentType packType, bool ignoreWarnings)
MCAPI ::std::optional<::World::PackActionError > _movePackContent(::std::string const &packIdVersion, ::ContentType packType, ::World::PackAction packAction, bool ignoreWarnings)
MCAPI ::std::shared_ptr<::ContentItemCollection > _getAvailableContentItemCollection(::ContentType contentType) const
MCAPI::WorldContentItemCollectionsModel _generatePackCollectionsModel()
MCAPI::WorldContentItemCollectionsModel $getWorldCollectionsModel() const
MCAPI ::std::optional<::World::PackActionError > $continuePendingPackAction()
MCAPI void $setEditorEnabled(bool isEditorEnabled)
MCAPI ::std::shared_ptr<::PackContentItem const > $getPackItemForPackIdVersion(::std::string_view packIdVersion)
MCAPI void $setContentSource(::std::unique_ptr<::ContentSource > &&contentSource)
MCAPI ::std::shared_ptr<::ContentItemCollection > _getMarketplacePassContentItemCollection(::ContentType contentType) const
STL namespace.
Definition SelectedReloadProps.h:7
Definition ContentSource.h:5
Definition PackContentItem.h:5
Definition PackSettingsInfo.h:5
Definition WorldContentItemCollectionsModel.h:5
Definition PendingPackAction.h:7