Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI void clearCollection(::std::string const& collectionName);
50
51 MCNAPI void deserialize(::CompoundTag const& root, ::cereal::ReflectionCtx const& ctx);
52
53 MCNAPI ::std::variant<double, float, bool, ::std::string, ::Vec3> const*
54 getDynamicProperty(::std::string const& key, ::std::string const& collectionName) const;
55
56 MCNAPI ::std::vector<::std::string> getDynamicPropertyIds(::std::string const& collectionName) const;
57
58 MCNAPI uint64 getTotalByteCount(::std::string const& collectionName) const;
59
60 MCNAPI bool removeDynamicProperty(::std::string const& key, ::std::string const& collectionName);
61
62 MCNAPI ::std::unique_ptr<::CompoundTag> serialize(::cereal::ReflectionCtx const& ctx) const;
63
64 MCNAPI void setDynamicProperty(
65 ::std::string const& key,
66 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value,
67 ::std::string const& collectionName
68 );
69
70 MCNAPI void updateCollectionName(::std::string const& from, ::std::string const& to);
71 // NOLINTEND
72
73public:
74 // static functions
75 // NOLINTBEGIN
76 MCNAPI static void bindType(::cereal::ReflectionCtx& ctx);
77
78 MCNAPI static ::std::optional<::Scripting::ArgumentOutOfBoundsError> validateDynamicProperty(
79 ::std::string const& key,
80 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
81 );
82
83 MCNAPI static ::std::string validateDynamicProperty_V010(
84 ::DynamicPropertyDefinition const* propertyDefinition,
85 ::std::string const& key,
86 ::std::variant<double, float, bool, ::std::string, ::Vec3> const* value
87 );
88 // NOLINTEND
89
90public:
91 // static variables
92 // NOLINTBEGIN
93 MCNAPI static ::std::string const& STORAGE_TAG();
94 // NOLINTEND
95};
Definition CompoundTag.h:18
Definition DynamicProperties.h:16
MCAPI uint64 getTotalByteCount(::std::string const &collectionName) const
MCAPI void deserialize(::CompoundTag const &root, ::cereal::ReflectionCtx const &ctx)
MCAPI ::std::vector<::std::string > getDynamicPropertyIds(::std::string const &collectionName) const
static MCAPI ::std::string validateDynamicProperty_V010(::DynamicPropertyDefinition const *propertyDefinition, ::std::string const &key, ::std::variant< double, float, bool, ::std::string, ::Vec3 > const *value)
MCAPI ::std::unique_ptr<::CompoundTag > serialize(::cereal::ReflectionCtx const &ctx) const
MCAPI void clearCollection(::std::string const &collectionName)
MCAPI ::std::variant< double, float, bool, ::std::string, ::Vec3 > const * getDynamicProperty(::std::string const &key, ::std::string const &collectionName) const
MCAPI void updateCollectionName(::std::string const &from, ::std::string const &to)
static MCAPI ::std::optional<::Scripting::ArgumentOutOfBoundsError > validateDynamicProperty(::std::string const &key, ::std::variant< double, float, bool, ::std::string, ::Vec3 > const *value)
static MCAPI void bindType(::cereal::ReflectionCtx &ctx)
MCAPI bool removeDynamicProperty(::std::string const &key, ::std::string const &collectionName)
MCAPI void setDynamicProperty(::std::string const &key, ::std::variant< double, float, bool, ::std::string, ::Vec3 > const &value, ::std::string const &collectionName)
static MCAPI ::std::string const & STORAGE_TAG()
Definition DynamicProperties.h:24
Definition DynamicPropertyDefinition.h:5
Definition ArgumentOutOfBoundsError.h:10
Definition ReflectionCtx.h:11
Definition ctx.h:5