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