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 MCAPI bool getResource(::Core::Path const& resourceName, ::std::string& resourceStream, int subpackIndex) const;
73
74 MCAPI_C ::Json::Value getTexturesList(int subpackIndex) const;
75
76 MCAPI_C bool hasExtraResourcesForLocale(::std::string const& code, int subpackIndex) const;
77
78 MCAPI_C bool hasIcon(::PackIconType iconType) const;
79
80 MCAPI bool hasResource(::Core::Path const& resourceName, int subpackIndex) const;
81
82 MCAPI bool isAssetExtractionViable() const;
83
84 MCAPI ::std::vector<::Bedrock::Resources::PreloadedPathHandle>
85 preloadPath(::Core::Path const& packRelativePath, int subpackIndex, bool) const;
86
87 MCAPI_C void regenerateAssetSet();
88
89 MCAPI void setLocale(::std::string const& code);
90
91 MCAPI ~ResourcePack();
92 // NOLINTEND
93
94public:
95 // static variables
96 // NOLINTBEGIN
97 MCAPI static ::Core::PathBuffer<::std::string> const& RESOURCE_PACK_BUG_ICON_PATH();
98
99 MCAPI static ::Core::PathBuffer<::std::string> const& RESOURCE_PACK_ICON_PATH();
100
101 MCAPI static ::Core::PathBuffer<::std::string> const& TEXTURES_LIST_PATH();
102 // NOLINTEND
103
104public:
105 // constructor thunks
106 // NOLINTBEGIN
107 MCAPI void* $ctor(::gsl::not_null<::std::shared_ptr<::Pack>> pack);
108 // NOLINTEND
109
110public:
111 // destructor thunk
112 // NOLINTBEGIN
113 MCAPI void $dtor();
114 // NOLINTEND
115};
Definition PreloadedPathHandle.h:15
Definition Path.h:10
Definition Value.h:16
Definition PackAccessStrategy.h:21
Definition Pack.h:27
Definition SubpackInfo.h:5
Definition code.h:5