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
44 MCAPI ~PropertyCollection();
45 // NOLINTEND
46
47 public:
48 // static functions
49 // NOLINTBEGIN
50 MCAPI static ::std::unordered_map<::std::string, ::std::variant<double, float, bool, ::std::string, ::Vec3>>
51 toVariantMap(::DynamicProperties::PropertyCollection const& collection);
52 // NOLINTEND
53
54 public:
55 // destructor thunk
56 // NOLINTBEGIN
57 MCAPI void $dtor();
58 // NOLINTEND
59 };
60
61 using PropertyVariant = ::std::variant<double, float, bool, ::std::string, ::Vec3>;
62
63public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::DynamicProperties::PropertyCollection>>
67 mPropertyCollections;
68 // NOLINTEND
69
70public:
71 // prevent constructor by default
72 DynamicProperties& operator=(DynamicProperties const&);
73 DynamicProperties(DynamicProperties const&);
74 DynamicProperties();
75
76public:
77 // member functions
78 // NOLINTBEGIN
79 MCAPI DynamicProperties(::DynamicProperties&&);
80
81 MCFOLD ::DynamicProperties::PropertyCollection const*
82 _getPropertyCollection(::std::string const& collectionName) const;
83
84 MCFOLD ::DynamicProperties::PropertyCollection* _getPropertyCollection(::std::string const& collectionName);
85
86 MCAPI void deserialize(::CompoundTag const& root, ::cereal::ReflectionCtx const& ctx);
87
88 MCAPI bool removeDynamicProperty(::std::string const& key, ::std::string const& collectionName);
89
90 MCAPI ::std::unique_ptr<::CompoundTag> serialize(::cereal::ReflectionCtx const& ctx) const;
91
92 MCAPI void setDynamicProperty(
93 ::std::string const& key,
94 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value,
95 ::std::string const& collectionName
96 );
97
98 MCAPI void updateCollectionName(::std::string const& from, ::std::string const& to);
99
100 MCAPI ~DynamicProperties();
101 // NOLINTEND
102
103public:
104 // static functions
105 // NOLINTBEGIN
106 MCAPI static ::std::optional<::Scripting::ArgumentOutOfBoundsError> validateDynamicProperty(
107 ::std::string const& key,
108 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
109 );
110 // NOLINTEND
111
112public:
113 // static variables
114 // NOLINTBEGIN
115 MCAPI static ::std::string const& STORAGE_TAG();
116 // NOLINTEND
117
118public:
119 // constructor thunks
120 // NOLINTBEGIN
121 MCAPI void* $ctor(::DynamicProperties&&);
122 // NOLINTEND
123
124public:
125 // destructor thunk
126 // NOLINTBEGIN
127 MCAPI void $dtor();
128 // NOLINTEND
129};
Definition CompoundTag.h:23
Definition Vec3.h:10
Definition DynamicProperties.h:21
Definition ArgumentOutOfBoundsError.h:15
Definition ReflectionCtx.h:11
Definition ctx.h:5