Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI void _addBoolProperty(::std::string const& name, bool clientSync, ::ExpressionNode&& defaultExpression);
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
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 MCNAPI void _reserveSpaceForTypes(::std::vector<uint64> const& typeCounts);
92#endif
93
94 MCNAPI bool getDefaultBoolValue(uint64 boolArrayIndex, ::RenderParams& renderParams) const;
95
97 uint64 enumIndexArrayIndex,
98 ::RenderParams& renderParams,
99 ::std::string const& propertyName
100 ) const;
101
102 MCNAPI float getDefaultFloatValue(uint64 floatArrayIndex, ::RenderParams& renderParams) const;
103
104 MCNAPI int getDefaultIntValue(uint64 intArrayIndex, ::RenderParams& renderParams) const;
105
106 MCNAPI ::PropertyMetadata const* getPropertyMetadata(uint64 propertyNameHash) const;
107
108 MCNAPI ::PropertyMetadata const* getPropertyMetadataByString(::std::string const& propertyName) const;
109 // NOLINTEND
110
111public:
112 // static functions
113 // NOLINTBEGIN
114 MCNAPI static ::PropertyMetadata::ContainedType _getJsonPropertyType(::Json::Value const& typeNode);
115
116 MCNAPI 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
MCAPI::PropertyMetadata const * getPropertyMetadataByString(::std::string const &propertyName) const
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 float getDefaultFloatValue(uint64 floatArrayIndex, ::RenderParams &renderParams) const
MCAPI::PropertyMetadata const * getPropertyMetadata(uint64 propertyNameHash) const
MCAPI void _addBoolProperty(::std::string const &name, bool clientSync, ::ExpressionNode &&defaultExpression)
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 void _addFloatProperty(::std::string const &name, bool clientSync, float defaultValue, float rangeMin, float rangeMax)
MCAPI bool _loadPropertyFromJson(::std::string const &name, ::Json::Value const &propertyNode, ::MolangVersion const molangVersion, bool clientSync)
MCAPI uint64 getDefaultEnumIndexValue(uint64 enumIndexArrayIndex, ::RenderParams &renderParams, ::std::string const &propertyName) const
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)
Definition PropertyMetadata.h:8
Definition RenderParams.h:29
Definition flat_map.h:15