Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ResourcePackLoader.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/ResourceLoaderBase.h"
8#include "mc/deps/game_refs/OwnerPtr.h"
9#include "mc/deps/game_refs/WeakRef.h"
10#include "mc/deps/resource_processing/category/CategoryFileMapping.h"
11#include "mc/deps/resource_processing/category/CategoryMergeStrategy.h"
12#include "mc/deps/resource_processing/category/CategoryMergeStrategyFactory.h"
13#include "mc/deps/resource_processing/category/ResourceCategory.h"
14#include "mc/platform/brstd/function_ref.h"
15#include "mc/resources/ResourceMergeOptions.h"
16
17// auto generated forward declare list
18// clang-format off
19class ContentIdentity;
21class PackInstance;
22class ResourceGroup;
27struct PackIdVersion;
29namespace Bedrock::Resources { class PreloadedPathHandle; }
30namespace Core { class Path; }
31namespace Core { class PathView; }
32namespace mce { class UUID; }
33namespace mce { struct Image; }
34// clang-format on
35
36class ResourcePackLoader : public ::ResourceLoaderBase {
37public:
38 // ResourcePackLoader inner types declare
39 // clang-format off
40 struct ConstructorKey;
43 // clang-format on
44
45 // ResourcePackLoader inner types define
46 struct ConstructorKey {};
47
49 public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<8, 16, ::brstd::function_ref<bool(::PackInstance const&)>> packInstanceFilter;
53 ::ll::TypedStorage<8, 136, ::std::optional<::ResourceMergeOptions>> mergeOptions;
54 ::ll::TypedStorage<2, 4, ::std::optional<::Bedrock::Resources::ResourceCategory>> loadAsCategory;
55 // NOLINTEND
56 };
57
59 public:
60 // member variables
61 // NOLINTBEGIN
62 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackStack>> stack;
63 ::ll::TypedStorage<8, 64, ::std::function<::Core::PathBuffer<::std::string>()>> getPath;
64 ::ll::TypedStorage<
65 8,
66 64,
68 mergeStrategyFactory;
69 ::ll::TypedStorage<8, 64, ::Bedrock::Resources::CategoryFileMapping> categoryFileMapping;
70 // NOLINTEND
71
72 public:
73 // member functions
74 // NOLINTBEGIN
75#ifdef LL_PLAT_C
77#endif
78 // NOLINTEND
79
80 public:
81 // destructor thunk
82 // NOLINTBEGIN
83#ifdef LL_PLAT_C
84 MCNAPI void $dtor();
85#endif
86 // NOLINTEND
87 };
88
89public:
90 // member variables
91 // NOLINTBEGIN
92 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackStack>> mFullStack;
93 ::ll::TypedStorage<8, 16, ::WeakRef<::ResourcePackLoader>> mWeakThis;
94 ::ll::TypedStorage<8, 64, ::Bedrock::Resources::CategoryFileMapping> mCategoryFileMapping;
95 ::ll::TypedStorage<
96 8,
97 64,
99 mMergeStrategyFactory;
100 // NOLINTEND
101
102#ifdef LL_PLAT_S
103#else // LL_PLAT_C
104public:
105 // prevent constructor by default
106 ResourcePackLoader();
107
108#endif
109public:
110 // virtual functions
111 // NOLINTBEGIN
112 virtual ~ResourcePackLoader() /*override*/ = default;
113
114 virtual bool load(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const /*override*/;
115
116 virtual bool load(
117 ::ResourceLocation const& resourceLocation,
118 ::std::string& resourceStream,
119 ::gsl::span<::std::string const> extensionList
120 ) const /*override*/;
121
122 virtual bool load(
123 ::ResourceLocationPair const& resourceLocationPair,
124 ::std::string& resourceStream,
125 ::gsl::span<::std::string const> extensionList
126 ) const /*override*/;
127
128#ifdef LL_PLAT_C
129 virtual ::mce::Image loadTexture(::ResourceLocation const& resourceLocation) const /*override*/;
130
131#endif
132 virtual ::Core::PathBuffer<::std::string> getPath(::ResourceLocation const& resourceLocation) const /*override*/;
133
134 virtual ::Core::PathBuffer<::std::string>
135 getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const
136 /*override*/;
137
138 virtual ::Core::PathBuffer<::std::string>
139 getPathContainingResource(::ResourceLocation const& resourceLocation) const /*override*/;
140
141 virtual ::std::pair<int, ::std::string_view> getPackStackIndexOfResource(
142 ::ResourceLocation const& resourceLocation,
143 ::gsl::span<::std::string const> extensionList
144 ) const /*override*/;
145
146 virtual bool hasCapability(::std::string_view requiredCapability) const;
147 // NOLINTEND
148
149public:
150 // member functions
151 // NOLINTBEGIN
152#ifdef LL_PLAT_C
154
155 MCNAPI ::std::optional<::Bedrock::Resources::CategoryMergeStrategy<::LoadedResourceData>> _loadIntoStrategy(
156 ::ResourceLocation const& resourceLocation,
158 ) const;
159
160 MCNAPI ::std::vector<::ResourceLocationPair> findAllTexturesInUse() const;
161
162 MCNAPI ::std::vector<::PackIdVersion> findInPacks(::ResourceLocation const& resourceLocation) const;
163#endif
164
165 MCNAPI ::std::vector<::PackInstance> getPacksWhereAssetExtractionNotViable(
166 ::std::function<::std::string(::ContentIdentity const&)> getContentKey,
167 ::std::string const& sourceContext
168 ) const;
169
170 MCNAPI ::ResourceGroup getResourcesOfGroup(::std::string const& group) const;
171
172 MCNAPI ::ResourceGroup getResourcesOfGroup(::PackInstance const& packInstance, ::std::string const& group) const;
173
174#ifdef LL_PLAT_C
175 MCNAPI ::std::optional<::StreamableAssetSource> getStreamableSource(
176 ::ResourceLocation const& resourceLocation,
177 ::gsl::span<::std::string const> extensionList,
178 ::std::optional<::Core::PathView> tempDirectory
179 ) const;
180#endif
181
183 ::std::function<::std::string(::ContentIdentity const&)> getContentKey,
184 ::std::string const& sourceContext
185 ) const;
186
187#ifdef LL_PLAT_C
188 MCNAPI bool load(
189 ::ResourceLocation const& resourceLocation,
190 ::std::string& resourceStream,
191 ::std::optional<::mce::UUID> packId
192 ) const;
193
194 MCNAPI bool loadAllVersionsOf(
195 ::ResourceLocation const& resourceLocation,
196 ::brstd::function_ref<bool(::PackInstance const&)> packInstanceFilter,
197 ::ResourcePackMergeStrategy& mergeStrategy
198 ) const;
199
200 MCNAPI ::std::vector<::Bedrock::Resources::PreloadedPathHandle>
201 preloadPath(::Core::Path const& packRelativePath) const;
202#endif
203 // NOLINTEND
204
205public:
206 // static functions
207 // NOLINTBEGIN
208 MCNAPI static bool _alwaysPassingPackFilter(::PackInstance const&);
209
210#ifdef LL_PLAT_C
211 MCNAPI static bool _hasResource(
212 ::ResourcePackStack const& resourcePackStack,
213 ::ResourceLocation const& resourceLocation,
214 ::gsl::span<::std::string const> extensionList
215 );
216
217 MCNAPI static ::OwnerPtr<::ResourcePackLoader> create(::ResourcePackLoader::ResourcePackLoaderArgs args);
218#endif
219 // NOLINTEND
220
221public:
222 // constructor thunks
223 // NOLINTBEGIN
224#ifdef LL_PLAT_C
226#endif
227 // NOLINTEND
228
229public:
230 // virtual function thunks
231 // NOLINTBEGIN
232 MCNAPI bool $load(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
233
234 MCNAPI bool $load(
235 ::ResourceLocation const& resourceLocation,
236 ::std::string& resourceStream,
237 ::gsl::span<::std::string const> extensionList
238 ) const;
239
240 MCAPI bool $load(
241 ::ResourceLocationPair const& resourceLocationPair,
242 ::std::string& resourceStream,
243 ::gsl::span<::std::string const> extensionList
244 ) const;
245
246 MCNAPI ::Core::PathBuffer<::std::string> $getPath(::ResourceLocation const& resourceLocation) const;
247
248 MCNAPI ::Core::PathBuffer<::std::string>
249 $getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const;
250
251 MCNAPI ::Core::PathBuffer<::std::string>
252 $getPathContainingResource(::ResourceLocation const& resourceLocation) const;
253
254 MCAPI ::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};
Definition CategoryMergeStrategyFactory.h:8
Definition PreloadedPathHandle.h:16
Definition ContentIdentity.h:8
Definition PathView.h:19
Definition Path.h:10
Definition LoadedResourceData.h:5
Definition PackInstance.h:16
Definition ResourceGroup.h:8
Definition ResourceLoaderBase.h:15
MCAPI void * $ctor(::std::function<::Core::PathBuffer<::std::string >()> getPath)
Definition ResourceLocationPair.h:9
Definition ResourceLocation.h:15
MCAPI::ResourceGroup getResourcesOfGroup(::std::string const &group) const
MCAPI ::Core::PathBuffer<::std::string > $getPath(::ResourceLocation const &resourceLocation, ::gsl::span<::std::string const > extensionList) const
MCAPI bool $load(::ResourceLocation const &resourceLocation, ::std::string &resourceStream) const
MCAPI bool isAssetExtractionViableForFullStack(::std::function<::std::string(::ContentIdentity const &)> getContentKey, ::std::string const &sourceContext) const
MCAPI::ResourceGroup getResourcesOfGroup(::PackInstance const &packInstance, ::std::string const &group) const
MCAPI ::Core::PathBuffer<::std::string > $getPathContainingResource(::ResourceLocation const &resourceLocation) const
MCAPI bool $hasCapability(::std::string_view requiredCapability) const
static MCAPI bool _alwaysPassingPackFilter(::PackInstance const &)
MCAPI ::Core::PathBuffer<::std::string > $getPath(::ResourceLocation const &resourceLocation) const
MCAPI ::std::vector<::PackInstance > getPacksWhereAssetExtractionNotViable(::std::function<::std::string(::ContentIdentity const &)> getContentKey, ::std::string const &sourceContext) const
MCAPI bool $load(::ResourceLocation const &resourceLocation, ::std::string &resourceStream, ::gsl::span<::std::string const > extensionList) const
Definition ResourcePackMergeStrategy.h:10
Definition ResourcePackStack.h:23
Definition function_ref.h:60
Definition UUID.h:8
Definition PackIdVersion.h:10
Definition ResourcePackLoader.h:46
Definition ResourcePackLoader.h:48
Definition ResourcePackLoader.h:58
Definition StreamableAssetSource.h:5
Definition Image.h:13