LeviLamina
Loading...
Searching...
No Matches
DynamicProperties.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7
8// auto generated forward declare list
9// clang-format off
10class CompoundTag;
12namespace Scripting { struct ArgumentOutOfBoundsError; }
13namespace cereal { struct ReflectionCtx; }
14// clang-format on
15
17public:
18 // DynamicProperties inner types declare
19 // clang-format off
20 struct PropertyCollection;
21 // clang-format on
22
23 // DynamicProperties inner types define
25 public:
26 // member variables
27 // NOLINTBEGIN
28 ::ll::TypedStorage<8, 8, uint64> mByteCount;
29 ::ll::TypedStorage<
30 8,
31 64,
32 ::std::unordered_map<::std::string, ::std::variant<double, float, bool, ::std::string, ::Vec3>>>
33 mProperties;
34 // NOLINTEND
35 };
36
37 using PropertyVariant = ::std::variant<double, float, bool, ::std::string, ::Vec3>;
38
39public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::DynamicProperties::PropertyCollection>>
43 mPropertyCollections;
44 // NOLINTEND
45
46public:
47 // member functions
48 // NOLINTBEGIN
49 MCFOLD ::DynamicProperties::PropertyCollection const*
50 _getPropertyCollection(::std::string const& collectionName) const;
51
52 MCFOLD ::DynamicProperties::PropertyCollection* _getPropertyCollection(::std::string const& collectionName);
53
54 MCAPI void clearCollection(::std::string const& collectionName);
55
56 MCAPI void deserialize(::CompoundTag const& root, ::cereal::ReflectionCtx const& ctx);
57
58 MCAPI ::std::variant<double, float, bool, ::std::string, ::Vec3> const*
59 getDynamicProperty(::std::string const& key, ::std::string const& collectionName) const;
60
61 MCAPI ::std::vector<::std::string> getDynamicPropertyIds(::std::string const& collectionName) const;
62
63 MCAPI bool removeDynamicProperty(::std::string const& key, ::std::string const& collectionName);
64
65 MCAPI ::std::unique_ptr<::CompoundTag> serialize(::cereal::ReflectionCtx const& ctx) const;
66
67 MCAPI void setDynamicProperty(
68 ::std::string const& key,
69 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value,
70 ::std::string const& collectionName
71 );
72
73 MCAPI void updateCollectionName(::std::string const& from, ::std::string const& to);
74 // NOLINTEND
75
76public:
77 // static functions
78 // NOLINTBEGIN
79 MCAPI static void bindType(::cereal::ReflectionCtx& ctx);
80
81 MCAPI static ::std::optional<::Scripting::ArgumentOutOfBoundsError> validateDynamicProperty(
82 ::std::string const& key,
83 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
84 );
85
86 MCAPI static ::std::string validateDynamicProperty_V010(
87 ::DynamicPropertyDefinition const* propertyDefinition,
88 ::std::string const& key,
89 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
90 );
91 // NOLINTEND
92
93public:
94 // static variables
95 // NOLINTBEGIN
96 MCAPI static ::std::string const& STORAGE_TAG();
97 // NOLINTEND
98};
Definition CompoundTag.h:18
Definition DynamicProperties.h:16
Definition DynamicProperties.h:24
Definition DynamicPropertyDefinition.h:5
Definition ArgumentOutOfBoundsError.h:10
Definition ReflectionCtx.h:11
Definition ctx.h:5