LeviLamina
Loading...
Searching...
No Matches
ResourcePackManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/resource/ResourceLoader.h"
8#include "mc/deps/core/resource/ResourcePackStackType.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10#include "mc/platform/brstd/move_only_function.h"
11
12// auto generated forward declare list
13// clang-format off
18class PackInstance;
20class ResourceGroup;
23class ResourcePack;
25struct PackIdVersion;
26namespace Core { class Path; }
27namespace mce { struct Image; }
28// clang-format on
29
30class ResourcePackManager : public ::ResourceLoader {
31public:
32 // member variables
33 // NOLINTBEGIN
49 // NOLINTEND
50
51public:
52 // prevent constructor by default
53 ResourcePackManager& operator=(ResourcePackManager const&);
54 ResourcePackManager(ResourcePackManager const&);
55 ResourcePackManager();
56
57public:
58 // virtual functions
59 // NOLINTBEGIN
60 virtual ~ResourcePackManager() /*override*/;
61
62 virtual bool load(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const /*override*/;
63
64 virtual bool load(
65 ::ResourceLocation const& resourceLocation,
66 ::std::string& resourceStream,
67 ::gsl::span<::std::string const> extensionList
68 ) const /*override*/;
69
70 virtual bool load(
71 ::ResourceLocationPair const& resourceLocationPair,
72 ::std::string& resourceStream,
73 ::gsl::span<::std::string const> extensionList
74 ) const /*override*/;
75
76 virtual bool loadText(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const /*override*/;
77
78 virtual ::std::vector<::LoadedResourceData> loadAllVersionsOf(::ResourceLocation const& resourceLocation) const
79 /*override*/;
80
81#ifdef LL_PLAT_C
82 virtual ::mce::Image loadTexture(::ResourceLocation const& resourceLocation) const /*override*/;
83
84#endif
85 virtual bool isInStreamableLocation(::ResourceLocation const& resourceLocation) const /*override*/;
86
87 virtual bool isInStreamableLocation(
88 ::ResourceLocation const& resourceLocation,
89 ::gsl::span<::std::string const> extensionList
90 ) const /*override*/;
91
92 virtual ::Core::PathBuffer<::std::string> getPath(::ResourceLocation const& resourceLocation) const /*override*/;
93
94 virtual ::Core::PathBuffer<::std::string>
95 getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const
96 /*override*/;
97
98 virtual ::Core::PathBuffer<::std::string>
99 getPathContainingResource(::ResourceLocation const& resourceLocation) const /*override*/;
100
101 virtual ::Core::PathBuffer<::std::string> getPathContainingResource(
102 ::ResourceLocation const& resourceLocation,
103 ::gsl::span<::std::string const> extensionList
104 ) const /*override*/;
105
106 virtual ::std::pair<int, ::std::string_view> getPackStackIndexOfResource(
107 ::ResourceLocation const& resourceLocation,
108 ::gsl::span<::std::string const> extensionList
109 ) const /*override*/;
110
111 virtual bool hasCapability(::std::string_view requiredCapability) const;
112 // NOLINTEND
113
114public:
115 // member functions
116 // NOLINTBEGIN
118 ::std::function<::Core::PathBuffer<::std::string>()> getPath,
119 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const> const& contentTierManager,
120 bool needsToInitialize
121 );
122
124
125 MCNAPI void _composeFullStack();
126
127 MCNAPI bool _doStackOperation(
128 ::ResourcePackStackType stackType,
129 ::brstd::move_only_function<bool(::std::unique_ptr<::ResourcePackStack>*) const> operation
130 );
131
133 ::PackInstance const& packInstance,
134 ::std::string const& group,
135 ::std::vector<::Core::Path>& resources
136 ) const;
137
139
140#ifdef LL_PLAT_C
141 MCNAPI ::ContentTierIncompatibleReason canSupportPacks();
142#endif
143
145 ::ResourcePackStack& output,
146 ::ResourcePackStack const& globalStack,
147 ::ResourcePackStack const& levelStack
148 ) const;
149
150#ifdef LL_PLAT_C
151 MCNAPI void ensureSupportedSubpacks();
152
153 MCNAPI ::std::vector<::ResourceLocationPair> findAllTexturesInUse() const;
154
155 MCNAPI ::std::vector<::PackIdVersion> findInPacks(::ResourceLocation const& resourceLocation) const;
156
157 MCNAPI void finishLoadingLinkedAssets(::LinkedAssetValidator& validator);
158
159 MCNAPI ::std::vector<::PackInstance> getIncompatiblePacks() const;
160#endif
161
162 MCNAPI ::ResourceGroup getResourcesOfGroup(::std::string const& group) const;
163
164 MCNAPI ::ResourceGroup getResourcesOfGroup(::PackInstance const& packInstance, ::std::string const& group) const;
165
166 MCNAPI ::ResourcePackStack const& getStack(::ResourcePackStackType stackType) const;
167
168#ifdef LL_PLAT_C
169 MCNAPI bool hasResource(::ResourceLocation const& resourceLocation) const;
170
171 MCNAPI bool hasResource(
172 ::ResourcePackStack const& resourcePackStack,
173 ::ResourceLocation const& resourceLocation,
174 ::gsl::span<::std::string const> extensionList
175 ) const;
176#endif
177
178 MCNAPI void iteratePacks(::std::function<void(::PackInstance const&)> const& pred) const;
179
180#ifdef LL_PLAT_C
181 MCNAPI void onLanguageChanged();
182#endif
183
184 MCNAPI void removeIf(::std::function<bool(::PackInstance const&)> const& pred);
185
186#ifdef LL_PLAT_C
187 MCNAPI void removePacks(::std::vector<::gsl::not_null<::ResourcePack const*>> const& packs);
188
189 MCNAPI void removeUnsupportedPacks();
190#endif
191
193
194 MCNAPI bool setStack(::std::unique_ptr<::ResourcePackStack> stack, ::ResourcePackStackType stackType);
195 // NOLINTEND
196
197public:
198 // constructor thunks
199 // NOLINTBEGIN
200 MCNAPI void* $ctor(
201 ::std::function<::Core::PathBuffer<::std::string>()> getPath,
202 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const> const& contentTierManager,
203 bool needsToInitialize
204 );
205 // NOLINTEND
206
207public:
208 // destructor thunk
209 // NOLINTBEGIN
210 MCNAPI void $dtor();
211 // NOLINTEND
212
213public:
214 // virtual function thunks
215 // NOLINTBEGIN
216 MCNAPI bool $load(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
217
218 MCNAPI bool $load(
219 ::ResourceLocation const& resourceLocation,
220 ::std::string& resourceStream,
221 ::gsl::span<::std::string const> extensionList
222 ) const;
223
224 MCNAPI bool $load(
225 ::ResourceLocationPair const& resourceLocationPair,
226 ::std::string& resourceStream,
227 ::gsl::span<::std::string const> extensionList
228 ) const;
229
230 MCNAPI bool $loadText(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
231
232 MCNAPI ::std::vector<::LoadedResourceData> $loadAllVersionsOf(::ResourceLocation const& resourceLocation) const;
233
234 MCNAPI bool $isInStreamableLocation(::ResourceLocation const& resourceLocation) const;
235
237 ::ResourceLocation const& resourceLocation,
238 ::gsl::span<::std::string const> extensionList
239 ) const;
240
241 MCNAPI ::Core::PathBuffer<::std::string> $getPath(::ResourceLocation const& resourceLocation) const;
242
243 MCNAPI ::Core::PathBuffer<::std::string>
244 $getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const;
245
246 MCNAPI ::Core::PathBuffer<::std::string>
247 $getPathContainingResource(::ResourceLocation const& resourceLocation) const;
248
249 MCNAPI ::Core::PathBuffer<::std::string> $getPathContainingResource(
250 ::ResourceLocation const& resourceLocation,
251 ::gsl::span<::std::string const> extensionList
252 ) const;
253
254 MCNAPI ::std::pair<int, ::std::string_view> $getPackStackIndexOfResource(
255 ::ResourceLocation const& resourceLocation,
256 ::gsl::span<::std::string const> extensionList
257 ) const;
258
259 MCNAPI bool $hasCapability(::std::string_view requiredCapability) const;
260
261#ifdef LL_PLAT_C
262 MCNAPI ::mce::Image $loadTexture(::ResourceLocation const& resourceLocation) const;
263#endif
264
265
266 // NOLINTEND
267
268public:
269 // vftables
270 // NOLINTBEGIN
271 MCNAPI static void** $vftable();
272 // NOLINTEND
273};
Definition ContentTierIncompatibleReason.h:5
Definition PathBuffer.h:8
Definition Path.h:17
Definition IContentTierManager.h:13
Definition LinkedAssetValidator.h:8
Definition LoadedResourceData.h:5
Definition PackInstance.h:17
Definition PackSourceReport.h:11
Definition ResourceGroup.h:8
Definition ResourceLoader.h:17
Definition ResourceLocationPair.h:11
Definition ResourceLocation.h:15
MCAPI ::std::vector<::LoadedResourceData > $loadAllVersionsOf(::ResourceLocation const &resourceLocation) const
MCAPI::ResourceGroup getResourcesOfGroup(::std::string const &group) const
MCAPI void setPackSourceReport(::PackSourceReport &&report)
MCAPI void _composeFullStack()
MCAPI bool $loadText(::ResourceLocation const &resourceLocation, ::std::string &resourceStream) const
MCAPI void iteratePacks(::std::function< void(::PackInstance const &)> const &pred) const
MCAPI int composeFullStack(::ResourcePackStack &output, ::ResourcePackStack const &globalStack, ::ResourcePackStack const &levelStack) const
MCAPI ResourcePackManager(::std::function<::Core::PathBuffer<::std::string >()> getPath, ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const > const &contentTierManager, bool needsToInitialize)
MCAPI void _calculateMinEngineVersionFromFullStack()
MCAPI ::Core::PathBuffer<::std::string > $getPathContainingResource(::ResourceLocation const &resourceLocation) const
MCAPI bool $isInStreamableLocation(::ResourceLocation const &resourceLocation) const
MCAPI bool $load(::ResourceLocation const &resourceLocation, ::std::string &resourceStream, ::gsl::span<::std::string const > extensionList) const
MCAPI::ResourceGroup getResourcesOfGroup(::PackInstance const &packInstance, ::std::string const &group) const
MCAPI void removeIf(::std::function< bool(::PackInstance const &)> const &pred)
static MCAPI void ** $vftable()
MCAPI bool $hasCapability(::std::string_view requiredCapability) const
MCAPI bool $load(::ResourceLocationPair const &resourceLocationPair, ::std::string &resourceStream, ::gsl::span<::std::string const > extensionList) const
MCAPI ::Core::PathBuffer<::std::string > $getPath(::ResourceLocation const &resourceLocation, ::gsl::span<::std::string const > extensionList) const
MCAPI ::std::pair< int, ::std::string_view > $getPackStackIndexOfResource(::ResourceLocation const &resourceLocation, ::gsl::span<::std::string const > extensionList) const
MCAPI void _updateLanguageSubpacks()
MCAPI void $dtor()
MCAPI void * $ctor(::std::function<::Core::PathBuffer<::std::string >()> getPath, ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const > const &contentTierManager, bool needsToInitialize)
MCAPI::ResourcePackStack const & getStack(::ResourcePackStackType stackType) const
MCAPI ::Core::PathBuffer<::std::string > $getPath(::ResourceLocation const &resourceLocation) const
MCAPI bool _doStackOperation(::ResourcePackStackType stackType, ::brstd::move_only_function< bool(::std::unique_ptr<::ResourcePackStack > *) const > operation)
MCAPI ::Core::PathBuffer<::std::string > $getPathContainingResource(::ResourceLocation const &resourceLocation, ::gsl::span<::std::string const > extensionList) const
MCAPI bool $load(::ResourceLocation const &resourceLocation, ::std::string &resourceStream) const
MCAPI void _getResourcesOfGroup(::PackInstance const &packInstance, ::std::string const &group, ::std::vector<::Core::Path > &resources) const
MCAPI bool setStack(::std::unique_ptr<::ResourcePackStack > stack, ::ResourcePackStackType stackType)
MCAPI bool $isInStreamableLocation(::ResourceLocation const &resourceLocation, ::gsl::span<::std::string const > extensionList) const
Definition ResourcePackStack.h:25
Definition ResourcePack.h:21
Definition move_only_function.h:9
Definition PackIdVersion.h:10
Definition Alias.h:14
Definition Image.h:12