LeviLamina
Loading...
Searching...
No Matches
DynamicProperties.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7class CompoundTag;
8class Vec3;
10namespace Scripting { struct ArgumentOutOfBoundsError; }
11namespace cereal { struct ReflectionCtx; }
12// clang-format on
13
15public:
16 // DynamicProperties inner types declare
17 // clang-format off
18 struct PropertyCollection;
19 // clang-format on
20
21 // DynamicProperties inner types define
23 public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<8, 8, uint64> mByteCount;
27 ::ll::TypedStorage<
28 8,
29 64,
30 ::std::unordered_map<::std::string, ::std::variant<double, float, bool, ::std::string, ::Vec3>>>
31 mProperties;
32 // NOLINTEND
33
34 public:
35 // member functions
36 // NOLINTBEGIN
37 MCAPI ~PropertyCollection();
38 // NOLINTEND
39
40 public:
41 // static functions
42 // NOLINTBEGIN
43 MCAPI static void fromVariantMap(
45 ::std::unordered_map<::std::string, ::std::variant<double, float, bool, ::std::string, ::Vec3>> const&
46 properties
47 );
48
49 MCAPI static ::std::unordered_map<::std::string, ::std::variant<double, float, bool, ::std::string, ::Vec3>>
50 toVariantMap(::DynamicProperties::PropertyCollection const& collection);
51 // NOLINTEND
52
53 public:
54 // destructor thunk
55 // NOLINTBEGIN
56 MCAPI void $dtor();
57 // NOLINTEND
58 };
59
60 using PropertyVariant = ::std::variant<double, float, bool, ::std::string, ::Vec3>;
61
62public:
63 // member variables
64 // NOLINTBEGIN
65 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::DynamicProperties::PropertyCollection>>
66 mPropertyCollections;
67 // NOLINTEND
68
69public:
70 // member functions
71 // NOLINTBEGIN
72 MCFOLD ::DynamicProperties::PropertyCollection const*
73 _getPropertyCollection(::std::string const& collectionName) const;
74
75 MCFOLD ::DynamicProperties::PropertyCollection* _getPropertyCollection(::std::string const& collectionName);
76
77 MCAPI void clearCollection(::std::string const& collectionName);
78
79 MCAPI void deserialize(::CompoundTag const& root, ::cereal::ReflectionCtx const& ctx);
80
81 MCFOLD uint64 getCollectionCount() const;
82
83 MCAPI ::std::variant<double, float, bool, ::std::string, ::Vec3> const*
84 getDynamicProperty(::std::string const& key, ::std::string const& collectionName) const;
85
86 MCAPI ::std::vector<::std::string> getDynamicPropertyIds(::std::string const& collectionName) const;
87
88 MCFOLD ::std::unordered_map<::std::string, ::DynamicProperties::PropertyCollection> const&
89 getPropertyCollections() const;
90
91 MCAPI uint64 getTotalByteCount() const;
92
93 MCAPI uint64 getTotalByteCount(::std::string const& collectionName) const;
94
95 MCAPI bool removeDynamicProperty(::std::string const& key, ::std::string const& collectionName);
96
97 MCAPI ::std::unique_ptr<::CompoundTag> serialize(::cereal::ReflectionCtx const& ctx) const;
98
99 MCAPI void setDynamicProperty(
100 ::std::string const& key,
101 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value,
102 ::std::string const& collectionName
103 );
104
105 MCAPI void updateCollectionName(::std::string const& from, ::std::string const& to);
106
107 MCAPI ~DynamicProperties();
108 // NOLINTEND
109
110public:
111 // static functions
112 // NOLINTBEGIN
113 MCAPI static void bindType(::cereal::ReflectionCtx& ctx);
114
115 MCAPI static ::std::optional<::Scripting::ArgumentOutOfBoundsError> validateDynamicProperty(
116 ::std::string const& key,
117 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
118 );
119
120 MCAPI static ::std::string validateDynamicProperty_V010(
121 ::DynamicPropertyDefinition const* propertyDefinition,
122 ::std::string const& key,
123 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
124 );
125 // NOLINTEND
126
127public:
128 // static variables
129 // NOLINTBEGIN
130 MCAPI static ::std::string const& STORAGE_TAG();
131 // NOLINTEND
132
133public:
134 // destructor thunk
135 // NOLINTBEGIN
136 MCFOLD void $dtor();
137 // NOLINTEND
138};
Definition CompoundTag.h:23
Definition DynamicProperties.h:14
Definition Vec3.h:10
Definition DynamicProperties.h:22
Definition DynamicPropertyDefinition.h:5
Definition ArgumentOutOfBoundsError.h:15
Definition ReflectionCtx.h:11
Definition ctx.h:5