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