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;
9namespace cereal { struct ReflectionCtx; }
10// clang-format on
11
13public:
14 // DynamicProperties inner types declare
15 // clang-format off
16 struct PropertyCollection;
17 // clang-format on
18
19 // DynamicProperties inner types define
20 using PropertyVariant = ::std::variant<double, float, bool, ::std::string, ::Vec3>;
21
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 // prevent constructor by default
36 PropertyCollection& operator=(PropertyCollection const&);
39
40 public:
41 // member functions
42 // NOLINTBEGIN
43 MCAPI ::DynamicProperties::PropertyCollection& operator=(::DynamicProperties::PropertyCollection&&);
44 // NOLINTEND
45
46 public:
47 // static functions
48 // NOLINTBEGIN
49 MCAPI static void fromVariantMap(
51 ::std::unordered_map<::std::string, ::std::variant<double, float, bool, ::std::string, ::Vec3>> const&
52 properties
53 );
54
55 MCAPI static ::std::unordered_map<::std::string, ::std::variant<double, float, bool, ::std::string, ::Vec3>>
56 toVariantMap(::DynamicProperties::PropertyCollection const& collection);
57 // NOLINTEND
58 };
59
60public:
61 // member variables
62 // NOLINTBEGIN
63 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::DynamicProperties::PropertyCollection>>
64 mPropertyCollections;
65 // NOLINTEND
66
67public:
68 // prevent constructor by default
69 DynamicProperties& operator=(DynamicProperties const&);
72
73public:
74 // member functions
75 // NOLINTBEGIN
77
78 MCAPI void deserialize(::CompoundTag const& root, ::cereal::ReflectionCtx const& ctx);
79
80 MCAPI ::std::vector<::std::string> getDynamicPropertyIds(::std::string const& collectionName) const;
81
82 MCAPI bool removeDynamicProperty(::std::string const& key, ::std::string const& collectionName);
83
84 MCAPI ::std::unique_ptr<::CompoundTag> serialize(::cereal::ReflectionCtx const& ctx) const;
85
86 MCAPI void setDynamicProperty(
87 ::std::string const& key,
88 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value,
89 ::std::string const& collectionName
90 );
91
92 MCAPI void updateCollectionName(::std::string const& from, ::std::string const& to);
93
94 MCAPI ~DynamicProperties();
95 // NOLINTEND
96
97public:
98 // static functions
99 // NOLINTBEGIN
100 MCAPI static ::std::optional<::std::string> validateDynamicProperty(
101 ::std::string const& key,
102 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
103 );
104 // NOLINTEND
105
106public:
107 // static variables
108 // NOLINTBEGIN
109 MCAPI static ::std::string const& STORAGE_TAG();
110 // NOLINTEND
111
112public:
113 // constructor thunks
114 // NOLINTBEGIN
115 MCAPI void* $ctor(::DynamicProperties&&);
116 // NOLINTEND
117
118public:
119 // destructor thunk
120 // NOLINTBEGIN
121 MCAPI void $dtor();
122 // NOLINTEND
123};
Definition CompoundTag.h:13
Definition DynamicProperties.h:12
Definition Vec3.h:10
Definition DynamicProperties.h:22
Definition ReflectionCtx.h:11
Definition ctx.h:5
Definition serialize.h:11