LeviLamina
Loading...
Searching...
No Matches
BlockComponentFactory.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/sem_ver/SemVersion.h"
7#include "mc/resources/IPackLoadScoped.h"
8#include "mc/util/CerealSchemaUpgradeSet.h"
9#include "mc/util/Factory.h"
10#include "mc/util/json_util/JsonSchemaObjectNode.h"
11
12// auto generated forward declare list
13// clang-format off
14class Experiments;
19namespace Json { class Value; }
20namespace JsonUtil { class EmptyClass; }
21namespace cereal { struct ReflectionCtx; }
22// clang-format on
23
24class BlockComponentFactory : public ::IPackLoadScoped, public ::Factory<::BlockComponentDescription> {
25public:
26 // BlockComponentFactory inner types declare
27 // clang-format off
28 struct ComponentMetadata;
29 // clang-format on
30
31 // BlockComponentFactory inner types define
32 struct ComponentMetadata {
33 public:
34 // ComponentMetadata inner types define
35 using Ctor = ::std::unique_ptr<::BlockComponentDescription> (*)();
36
37 using ParseFunction =
38 ::std::function<bool(::Experiments const&, ::Json::Value const&, ::SemVersion const&, bool)>;
39
40 public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockComponentDescription> (*)()> makeUnique;
44 ::ll::TypedStorage<8, 24, ::std::vector<::PackLoadRequirement>> requirements;
45 ::ll::TypedStorage<8, 32, ::std::optional<::SemVersion>> releasedMinFormatVersion;
46 ::ll::TypedStorage<8, 24, ::CerealSchemaUpgradeSet> versionUpgrades;
47 ::ll::TypedStorage<
48 8,
49 64,
50 ::std::function<bool(::Experiments const&, ::Json::Value const&, ::SemVersion const&, bool)>>
51 onParseCallback;
52 ::ll::TypedStorage<1, 1, bool> mIsCustomComponent;
53 // NOLINTEND
54
55 public:
56 // prevent constructor by default
57 ComponentMetadata& operator=(ComponentMetadata const&);
58 ComponentMetadata(ComponentMetadata const&);
59 ComponentMetadata();
60
61 public:
62 // member functions
63 // NOLINTBEGIN
64 MCAPI ::BlockComponentFactory::ComponentMetadata& operator=(::BlockComponentFactory::ComponentMetadata&&);
65
66 MCAPI ~ComponentMetadata();
67 // NOLINTEND
68
69 public:
70 // destructor thunk
71 // NOLINTBEGIN
72 MCAPI void $dtor();
73 // NOLINTEND
74 };
75
76 using CerealComponentsMap = ::std::unordered_map<::std::string, ::BlockComponentFactory::ComponentMetadata>;
77
78public:
79 // member variables
80 // NOLINTBEGIN
81 ::ll::TypedStorage<
82 8,
83 16,
84 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::BlockComponentGroupDescription>>>
85 mBlockComponentsSchema;
86 // NOLINTEND
87
88public:
89 // prevent constructor by default
90 BlockComponentFactory(BlockComponentFactory const&);
91 BlockComponentFactory();
92
93public:
94 // virtual functions
95 // NOLINTBEGIN
96 virtual ~BlockComponentFactory() /*override*/;
97 // NOLINTEND
98
99public:
100 // member functions
101 // NOLINTBEGIN
102 MCAPI explicit BlockComponentFactory(::IPackLoadContext const* packLoadContext);
103
104 MCAPI void _buildBlockComponentsSchema();
105
106 MCAPI void _registerLegacyDescriptions(::IPackLoadContext const* packLoadContext);
107
108 MCAPI ::std::unique_ptr<::BlockComponentDescription>
109 createDescription(::std::string const& name, ::cereal::ReflectionCtx const& ctx) const;
110
111 MCAPI ::BlockComponentFactory& operator=(::BlockComponentFactory const&);
112 // NOLINTEND
113
114public:
115 // static functions
116 // NOLINTBEGIN
117 MCAPI static void registerAllCerealDescriptions(::cereal::ReflectionCtx& ctx);
118
119 MCAPI static ::std::unordered_map<::std::string, ::BlockComponentFactory::ComponentMetadata>&
120 setupContextInstanceIfRequired(::cereal::ReflectionCtx& ctx);
121 // NOLINTEND
122
123public:
124 // constructor thunks
125 // NOLINTBEGIN
126 MCAPI void* $ctor(::IPackLoadContext const* packLoadContext);
127 // NOLINTEND
128
129public:
130 // destructor thunk
131 // NOLINTBEGIN
132 MCAPI void $dtor();
133 // NOLINTEND
134
135public:
136 // vftables
137 // NOLINTBEGIN
138 MCNAPI static void** $vftable();
139 // NOLINTEND
140};
static MCAPI void ** $vftable()
Definition Experiments.h:14
Definition Factory.h:6
Definition IPackLoadContext.h:20
Definition EmptyClass.h:7
Definition Value.h:16
Definition PackLoadRequirement.h:13
Definition SemVersion.h:15
Definition BlockComponentDescription.h:20
Definition BlockComponentFactory.h:32
Definition BlockComponentGroupDescription.h:13
Definition IPackLoadScoped.h:5
Definition ReflectionCtx.h:11
Definition ctx.h:5