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 MCAPI PropertyGroup();
41
42 MCAPI void _addBoolProperty(::std::string const& name, bool clientSync, bool defaultValue);
43
44 MCAPI void _addEnumIndexProperty(
45 ::std::string const& name,
46 bool clientSync,
47 ::ExpressionNode&& defaultExpression,
48 ::std::vector<::HashedString> const& enumValues
49 );
50
51 MCAPI void _addEnumIndexProperty(
52 ::std::string const& name,
53 bool clientSync,
54 uint64 defaultValue,
55 ::std::vector<::HashedString> const& enumValues
56 );
57
58 MCAPI void
59 _addFloatProperty(::std::string const& name, bool clientSync, float defaultValue, float rangeMin, float rangeMax);
60
61 MCAPI void
62 _addIntProperty(::std::string const& name, bool clientSync, int defaultValue, int rangeMin, int rangeMax);
63
64 MCAPI void
65 _addPropertyMetadata(::std::string const& name, bool clientSync, ::PropertyMetadata::ContainedType propertyType);
66
67 MCAPI ::std::string const& _getFriendlyJsonTypeString(::PropertyMetadata::ContainedType type);
68
69 MCAPI bool _loadPropertyFromJson(
70 ::std::string const& name,
71 ::Json::Value const& propertyNode,
72 ::MolangVersion molangVersion,
73 bool clientSync
74 );
75
76 MCAPI void _reserveSpaceForTypes(::std::vector<uint64> const& typeCounts);
77
78 MCAPI bool _validateDataType(::Json::Value const& value, ::PropertyMetadata::ContainedType type);
79
80 MCAPI bool getDefaultBoolValue(uint64 boolArrayIndex, ::RenderParams& renderParams) const;
81
82 MCAPI uint64 getDefaultEnumIndexValue(
83 uint64 enumIndexArrayIndex,
84 ::RenderParams& renderParams,
85 ::std::string const& propertyName
86 ) const;
87
88 MCAPI float getDefaultFloatValue(uint64 floatArrayIndex, ::RenderParams& renderParams) const;
89
90 MCAPI int getDefaultIntValue(uint64 intArrayIndex, ::RenderParams& renderParams) const;
91
92 MCAPI ::ListTag getNetworkSyncPropertyDescriptionsAsListTag() const;
93
94 MCAPI ::PropertyMetadata const* getPropertyMetadata(uint64 propertyNameHash) const;
95
96 MCAPI ~PropertyGroup();
97 // NOLINTEND
98
99public:
100 // static functions
101 // NOLINTBEGIN
102 MCAPI static ::PropertyMetadata::ContainedType _getJsonPropertyType(::Json::Value const& typeNode);
103
104 MCAPI static bool
105 _tryGetClientSync(::std::string const& propertyName, ::Json::Value const& propertyNode, bool& clientSyncOut);
106
107 MCAPI static bool isValidEnumEntry(::std::string const& entryValue);
108
109 MCAPI static ::std::shared_ptr<::PropertyGroup const>
110 loadPropertiesFromJson(::Json::Value const& root, ::MolangVersion molangVersion);
111 // NOLINTEND
112
113public:
114 // static variables
115 // NOLINTBEGIN
116 MCAPI static uint64 const& MAX_ENUM_SIZE();
117
118 MCAPI static uint64 const& MAX_ENUM_VALUE_SIZE();
119 // NOLINTEND
120
121public:
122 // constructor thunks
123 // NOLINTBEGIN
124 MCAPI void* $ctor();
125 // NOLINTEND
126
127public:
128 // destructor thunk
129 // NOLINTBEGIN
130 MCAPI void $dtor();
131 // NOLINTEND
132};
Definition ExpressionNode.h:31
Definition HashedString.h:5
Definition Value.h:16
Definition ListTag.h:12
Definition PropertyGroup.h:19
Definition PropertyMetadata.h:5
Definition RenderParams.h:30
Definition Alias.h:14