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