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/platform/brstd/flat_map.h"
8#include "mc/world/actor/state/DefaultPropertyValues.h"
9#include "mc/world/actor/state/PropertyMetadata.h"
10
11// auto generated forward declare list
12// clang-format off
13class ExpressionNode;
14class HashedString;
16class RenderParams;
17namespace Json { class Value; }
18// clang-format on
19
20class PropertyGroup : public ::std::enable_shared_from_this<::PropertyGroup> {
21public:
22 // member variables
23 // NOLINTBEGIN
24 ::ll::TypedStorage<8, 24, ::std::vector<::PropertyMetadata>> mPropertyMetadata;
25 ::ll::TypedStorage<
26 8,
27 48,
28 ::brstd::flat_map<uint64, uint64, ::std::less<uint64>, ::std::vector<uint64>, ::std::vector<int64>>>
29 mPropertyIndexesByHash;
30 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, uint64>> mPropertyIndexesByString;
31 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<int, int>>> mIntPropertyLimits;
32 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<float, float>>> mFloatPropertyLimits;
33 ::ll::TypedStorage<8, 24, ::std::vector<::std::vector<::HashedString>>> mStringEnumValues;
34 ::ll::TypedStorage<8, 96, ::DefaultPropertyValues> mDefaultValues;
35 // NOLINTEND
36
37public:
38 // member functions
39 // NOLINTBEGIN
40 MCAPI void _addBoolProperty(::std::string const& name, bool clientSync, ::ExpressionNode&& defaultExpression);
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 _addFloatProperty(
59 ::std::string const& name,
60 bool clientSync,
61 ::ExpressionNode&& defaultExpression,
62 float rangeMin,
63 float rangeMax
64 );
65
66 MCAPI void
67 _addFloatProperty(::std::string const& name, bool clientSync, float defaultValue, float rangeMin, float rangeMax);
68
69 MCAPI void _addIntProperty(
70 ::std::string const& name,
71 bool clientSync,
72 ::ExpressionNode&& defaultExpression,
73 int rangeMin,
74 int rangeMax
75 );
76
77 MCAPI void
78 _addIntProperty(::std::string const& name, bool clientSync, int defaultValue, int rangeMin, int rangeMax);
79
80 MCAPI void
81 _addPropertyMetadata(::std::string const& name, bool clientSync, ::PropertyMetadata::ContainedType propertyType);
82
83 MCAPI bool _loadPropertyFromJson(
84 ::std::string const& name,
85 ::Json::Value const& propertyNode,
86 ::MolangVersion const molangVersion,
87 bool clientSync
88 );
89
90#ifdef LL_PLAT_C
91 MCAPI void _reserveSpaceForTypes(::std::vector<uint64> const& typeCounts);
92#endif
93
94 MCAPI bool getDefaultBoolValue(uint64 boolArrayIndex, ::RenderParams& renderParams) const;
95
96 MCAPI uint64 getDefaultEnumIndexValue(
97 uint64 enumIndexArrayIndex,
98 ::RenderParams& renderParams,
99 ::std::string const& propertyName
100 ) const;
101
102 MCAPI float getDefaultFloatValue(uint64 floatArrayIndex, ::RenderParams& renderParams) const;
103
104 MCAPI int getDefaultIntValue(uint64 intArrayIndex, ::RenderParams& renderParams) const;
105
106 MCAPI ::PropertyMetadata const* getPropertyMetadata(uint64 propertyNameHash) const;
107
108 MCAPI ::PropertyMetadata const* getPropertyMetadataByString(::std::string const& propertyName) const;
109 // NOLINTEND
110
111public:
112 // static functions
113 // NOLINTBEGIN
114 MCAPI static ::PropertyMetadata::ContainedType _getJsonPropertyType(::Json::Value const& typeNode);
115
116 MCAPI static ::std::shared_ptr<::PropertyGroup const>
117 loadPropertiesFromJson(::Json::Value const& root, ::MolangVersion molangVersion);
118 // NOLINTEND
119};
Definition ExpressionNode.h:35
Definition HashedString.h:5
Definition Value.h:16
Definition PropertyGroup.h:20
Definition PropertyMetadata.h:8
Definition RenderParams.h:29
Definition flat_map.h:15