LeviLamina
Loading...
Searching...
No Matches
ResourcePack.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/resources/PackIconType.h"
8#include "mc/resources/PackReport.h"
9#include "mc/resources/ResourceSignature.h"
10
11// auto generated forward declare list
12// clang-format off
13class Pack;
15struct SubpackInfo;
16namespace Bedrock::Resources { class PreloadedPathHandle; }
17namespace Core { class Path; }
18namespace Json { class Value; }
19// clang-format on
20
21class ResourcePack {
22public:
23 // ResourcePack inner types define
24 using Callback = ::std::function<void(::Core::Path const&)>;
25
26public:
27 // member variables
28 // NOLINTBEGIN
29 ::ll::TypedStorage<1, 1, bool> mHidden;
30 ::ll::TypedStorage<1, 1, bool> mError;
31 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::Pack>>> mPack;
32 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PackAccessStrategy>> mSubpackAccessStrategy;
33 ::ll::TypedStorage<8, 248, ::PackReport> mPackReport;
34 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::Pack>>> mSubPacks;
35 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ResourcePack>>> mSubResourcePacks;
36 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mIconPath;
37 ::ll::TypedStorage<8, 8, double> mLoadTime;
38 ::ll::TypedStorage<1, 1, bool> mIsBaseGamePack;
39 ::ll::TypedStorage<1, 1, bool> mIsSlicePack;
40 ::ll::TypedStorage<8, 64, ::ResourceSignature> mResourceSignature;
41 ::ll::TypedStorage<1, 1, bool> mIsMarkedForRemoval;
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
46 ResourcePack();
47
48public:
49 // member functions
50 // NOLINTBEGIN
51 MCAPI explicit ResourcePack(::gsl::not_null<::std::shared_ptr<::Pack>> pack);
52
53 MCAPI void _createSubpack(::SubpackInfo const& subpackInfo);
54
55 MCAPI void _createSubpacks();
56
57 MCAPI void _generateIconPath();
58
59 MCAPI bool _supportsPreload() const;
60
61 MCAPI bool areKnownFilesValid();
62
63 MCAPI void forEachIn(
64 ::Core::Path const& filePath,
65 ::std::function<void(::Core::Path const&)> callback,
66 int subpackIndex,
67 bool recurseAnyways
68 ) const;
69
70 MCAPI void generateAssetSet();
71
72#ifdef LL_PLAT_C
73 MCAPI ::Core::PathBuffer<::std::string> getIconPath(::PackIconType iconType) const;
74#endif
75
76 MCAPI bool getResource(::Core::Path const& resourceName, ::std::string& resourceStream, int subpackIndex) const;
77
78#ifdef LL_PLAT_C
79 MCAPI ::Json::Value getTexturesList(int subpackIndex) const;
80
81 MCAPI bool hasExtraResourcesForLocale(::std::string const& code, int subpackIndex) const;
82
83 MCAPI bool hasIcon(::PackIconType iconType) const;
84#endif
85
86 MCAPI bool hasResource(::Core::Path const& resourceName, int subpackIndex) const;
87
88 MCAPI bool isAssetExtractionViable() const;
89
90 MCAPI ::std::vector<::Bedrock::Resources::PreloadedPathHandle>
91 preloadPath(::Core::Path const& packRelativePath, int subpackIndex, bool) const;
92
93#ifdef LL_PLAT_C
94 MCAPI void regenerateAssetSet();
95#endif
96
97 MCAPI void setLocale(::std::string const& code);
98
99 MCAPI ~ResourcePack();
100 // NOLINTEND
101
102public:
103 // static variables
104 // NOLINTBEGIN
105 MCAPI static ::Core::PathBuffer<::std::string> const& RESOURCE_PACK_BUG_ICON_PATH();
106
107 MCAPI static ::Core::PathBuffer<::std::string> const& RESOURCE_PACK_ICON_PATH();
108
109 MCAPI static ::Core::PathBuffer<::std::string> const& TEXTURES_LIST_PATH();
110 // NOLINTEND
111
112public:
113 // constructor thunks
114 // NOLINTBEGIN
115 MCAPI void* $ctor(::gsl::not_null<::std::shared_ptr<::Pack>> pack);
116 // NOLINTEND
117
118public:
119 // destructor thunk
120 // NOLINTBEGIN
121 MCAPI void $dtor();
122 // NOLINTEND
123};
Definition PreloadedPathHandle.h:15
Definition Path.h:17
Definition Value.h:16
Definition PackAccessStrategy.h:21
Definition Pack.h:27
Definition SubpackInfo.h:5
Definition code.h:5