LeviLamina
Loading...
Searching...
No Matches
PropertyComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/actor/state/PropertyContainer.h"
7#include "mc/world/actor/state/PropertyMetadata.h"
8
9// auto generated forward declare list
10// clang-format off
11class CompoundTag;
12class HashedString;
14class PropertyGroup;
15class RenderParams;
16class Tag;
17struct MolangScriptArg;
18struct PropertySyncData;
19// clang-format on
20
21class PropertyComponent {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::PropertyGroup const>>> mPropertyGroup;
26 ::ll::TypedStorage<4, 4, ::std::bitset<32>> mDirtyIntProperties;
27 ::ll::TypedStorage<4, 4, ::std::bitset<32>> mDirtyFloatProperties;
28 ::ll::TypedStorage<4, 4, ::std::bitset<32>> mDirtyBoolProperties;
29 ::ll::TypedStorage<4, 4, ::std::bitset<32>> mDirtyEnumIndexProperties;
30 ::ll::TypedStorage<1, 1, bool> mEverythingDirty;
31 ::ll::TypedStorage<8, 120, ::PropertyContainer> mPropertyContainer;
32 // NOLINTEND
33
34public:
35 // prevent constructor by default
36 PropertyComponent& operator=(PropertyComponent const&);
37 PropertyComponent(PropertyComponent const&);
38 PropertyComponent();
39
40public:
41 // member functions
42 // NOLINTBEGIN
43 MCAPI PropertyComponent(::PropertyComponent&&);
44
45 MCAPI PropertyComponent(
46 ::gsl::not_null<::std::shared_ptr<::PropertyGroup const>> propertyGroup,
47 ::RenderParams& renderParams
48 );
49
50 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
51
52 MCAPI void
53 applyPendingChanges(::std::unordered_map<uint64, ::std::variant<int, float, bool, uint64>> const& pendingChanges);
54
55 MCAPI bool getBool(uint64 h) const;
56
57 MCAPI float getFloat(uint64 h) const;
58
59 MCAPI int getInt(uint64 h) const;
60
61 MCAPI bool getMolangValue(uint64 propertyNameHash, ::MolangScriptArg& out) const;
62
63 MCAPI ::PropertyMetadata::ContainedType getPropertyType(uint64 h) const;
64
65 MCAPI ::HashedString const& getString(uint64 h) const;
66
67 MCAPI bool hasDirtyProperties() const;
68
69 MCAPI ::PropertySyncData packAllSyncData() const;
70
71 MCAPI ::PropertySyncData packDirtySyncData();
72
73 MCAPI void readLoadedProperties(::CompoundTag const& loadedPropertyTag);
74
75 MCAPI void setAliasProperties(
76 ::std::unordered_map<::HashedString, ::std::shared_ptr<::Tag>> const& aliasProperties,
77 ::std::string const& aliasName,
78 ::std::string const& canonicalName
79 );
80
81 MCAPI ::std::optional<bool> tryGetBool(uint64 h) const;
82
83 MCAPI ::std::optional<float> tryGetFloat(uint64 h) const;
84
85 MCAPI ::std::optional<int> tryGetInt(uint64 h) const;
86
87 MCAPI ::HashedString const* tryGetString(uint64 h) const;
88
89 MCAPI ::std::optional<::std::variant<int, float, bool, ::std::string>>
90 tryGetValueVariant(uint64 propertyNameHash) const;
91 // NOLINTEND
92
93public:
94 // constructor thunks
95 // NOLINTBEGIN
96 MCAPI void* $ctor(::PropertyComponent&&);
97
98 MCAPI void*
99 $ctor(::gsl::not_null<::std::shared_ptr<::PropertyGroup const>> propertyGroup, ::RenderParams& renderParams);
100 // NOLINTEND
101};
Definition CompoundTag.h:23
Definition HashedString.h:5
Definition PropertyContainer.h:21
Definition PropertyGroup.h:21
Definition RenderParams.h:30
Definition Tag.h:42
Definition MolangScriptArg.h:35
Definition PropertySyncData.h:5