LeviLamina
Loading...
Searching...
No Matches
PropertyGroup.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/molang/MolangVersion.h"
7#include "mc/world/actor/state/PropertyMetadata.h"
8
9// auto generated forward declare list
10// clang-format off
11class ExpressionNode;
12class HashedString;
13class ListTag;
15class RenderParams;
16namespace Json { class Value; }
17// clang-format on
18
19class PropertyGroup : public ::std::enable_shared_from_this<::PropertyGroup> {
20public:
21 // member variables
22 // NOLINTBEGIN
30 // NOLINTEND
31
32public:
33 // prevent constructor by default
34 PropertyGroup& operator=(PropertyGroup const&);
36
37public:
38 // member functions
39 // NOLINTBEGIN
40 MCNAPI PropertyGroup();
41
42 MCNAPI void _addBoolProperty(::std::string const& name, bool clientSync, bool defaultValue);
43
45 ::std::string const& name,
46 bool clientSync,
47 ::ExpressionNode&& defaultExpression,
48 ::std::vector<::HashedString> const& enumValues
49 );
50
52 ::std::string const& name,
53 bool clientSync,
54 uint64 defaultValue,
55 ::std::vector<::HashedString> const& enumValues
56 );
57
58 MCNAPI void _addFloatProperty(
59 ::std::string const& name,
60 bool clientSync,
61 ::ExpressionNode&& defaultExpression,
62 float rangeMin,
63 float rangeMax
64 );
65
66 MCNAPI void
67 _addFloatProperty(::std::string const& name, bool clientSync, float defaultValue, float rangeMin, float rangeMax);
68
69 MCNAPI void _addIntProperty(
70 ::std::string const& name,
71 bool clientSync,
72 ::ExpressionNode&& defaultExpression,
73 int rangeMin,
74 int rangeMax
75 );
76
77 MCNAPI void
78 _addIntProperty(::std::string const& name, bool clientSync, int defaultValue, int rangeMin, int rangeMax);
79
80 MCNAPI void
81 _addPropertyMetadata(::std::string const& name, bool clientSync, ::PropertyMetadata::ContainedType propertyType);
82
83 MCNAPI ::std::string const& _getFriendlyJsonTypeString(::PropertyMetadata::ContainedType type);
84
86 ::std::string const& name,
87 ::Json::Value const& propertyNode,
88 ::MolangVersion molangVersion,
89 bool clientSync
90 );
91
92 MCNAPI void _reserveSpaceForTypes(::std::vector<uint64> const& typeCounts);
93
94 MCNAPI bool _validateDataType(::Json::Value const& value, ::PropertyMetadata::ContainedType type);
95
96 MCNAPI bool getDefaultBoolValue(uint64 boolArrayIndex, ::RenderParams& renderParams) const;
97
99 uint64 enumIndexArrayIndex,
100 ::RenderParams& renderParams,
101 ::std::string const& propertyName
102 ) const;
103
104 MCNAPI float getDefaultFloatValue(uint64 floatArrayIndex, ::RenderParams& renderParams) const;
105
106 MCNAPI int getDefaultIntValue(uint64 intArrayIndex, ::RenderParams& renderParams) const;
107
109
110 MCNAPI ::PropertyMetadata const* getPropertyMetadata(uint64 propertyNameHash) const;
111
113 // NOLINTEND
114
115public:
116 // static functions
117 // NOLINTBEGIN
118 MCNAPI static ::PropertyMetadata::ContainedType _getJsonPropertyType(::Json::Value const& typeNode);
119
120 MCNAPI static bool
121 _tryGetClientSync(::std::string const& propertyName, ::Json::Value const& propertyNode, bool& clientSyncOut);
122
123 MCNAPI static bool isValidEnumEntry(::std::string const& entryValue);
124
125 MCNAPI static ::std::shared_ptr<::PropertyGroup const>
126 loadPropertiesFromJson(::Json::Value const& root, ::MolangVersion molangVersion);
127 // NOLINTEND
128
129public:
130 // static variables
131 // NOLINTBEGIN
132 MCNAPI static uint64 const& MAX_ENUM_SIZE();
133
134 MCNAPI static uint64 const& MAX_ENUM_VALUE_SIZE();
135 // NOLINTEND
136
137public:
138 // constructor thunks
139 // NOLINTBEGIN
140 MCNAPI void* $ctor();
141 // NOLINTEND
142
143public:
144 // destructor thunk
145 // NOLINTBEGIN
146 MCNAPI void $dtor();
147 // NOLINTEND
148};
Definition ExpressionNode.h:27
Definition HashedString.h:5
Definition Value.h:16
Definition ListTag.h:12
Definition PropertyGroup.h:19
MCAPI void _addBoolProperty(::std::string const &name, bool clientSync, bool defaultValue)
MCAPI void _addFloatProperty(::std::string const &name, bool clientSync, ::ExpressionNode &&defaultExpression, float rangeMin, float rangeMax)
MCAPI void _addIntProperty(::std::string const &name, bool clientSync, int defaultValue, int rangeMin, int rangeMax)
MCAPI ~PropertyGroup()
MCAPI float getDefaultFloatValue(uint64 floatArrayIndex, ::RenderParams &renderParams) const
MCAPI bool _validateDataType(::Json::Value const &value, ::PropertyMetadata::ContainedType type)
MCAPI::PropertyMetadata const * getPropertyMetadata(uint64 propertyNameHash) const
static MCAPI uint64 const & MAX_ENUM_SIZE()
MCAPI void $dtor()
MCAPI void _addIntProperty(::std::string const &name, bool clientSync, ::ExpressionNode &&defaultExpression, int rangeMin, int rangeMax)
MCAPI bool getDefaultBoolValue(uint64 boolArrayIndex, ::RenderParams &renderParams) const
MCAPI void _addEnumIndexProperty(::std::string const &name, bool clientSync, ::ExpressionNode &&defaultExpression, ::std::vector<::HashedString > const &enumValues)
MCAPI void _addPropertyMetadata(::std::string const &name, bool clientSync, ::PropertyMetadata::ContainedType propertyType)
static MCAPI ::PropertyMetadata::ContainedType _getJsonPropertyType(::Json::Value const &typeNode)
MCAPI int getDefaultIntValue(uint64 intArrayIndex, ::RenderParams &renderParams) const
MCAPI PropertyGroup()
static MCAPI bool _tryGetClientSync(::std::string const &propertyName, ::Json::Value const &propertyNode, bool &clientSyncOut)
MCAPI void _addFloatProperty(::std::string const &name, bool clientSync, float defaultValue, float rangeMin, float rangeMax)
static MCAPI bool isValidEnumEntry(::std::string const &entryValue)
MCAPI void * $ctor()
MCAPI::ListTag getNetworkSyncPropertyDescriptionsAsListTag() const
MCAPI uint64 getDefaultEnumIndexValue(uint64 enumIndexArrayIndex, ::RenderParams &renderParams, ::std::string const &propertyName) const
MCAPI void _reserveSpaceForTypes(::std::vector< uint64 > const &typeCounts)
MCAPI::std::string const & _getFriendlyJsonTypeString(::PropertyMetadata::ContainedType type)
MCAPI void _addEnumIndexProperty(::std::string const &name, bool clientSync, uint64 defaultValue, ::std::vector<::HashedString > const &enumValues)
static MCAPI ::std::shared_ptr<::PropertyGroup const > loadPropertiesFromJson(::Json::Value const &root, ::MolangVersion molangVersion)
static MCAPI uint64 const & MAX_ENUM_VALUE_SIZE()
MCAPI bool _loadPropertyFromJson(::std::string const &name, ::Json::Value const &propertyNode, ::MolangVersion molangVersion, bool clientSync)
Definition PropertyMetadata.h:5
Definition RenderParams.h:30
Definition Alias.h:14