LeviLamina
Loading...
Searching...
No Matches
DwellerComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/string/HashedString.h"
7#include "mc/entity/components_json_legacy/DwellerRole.h"
8#include "mc/platform/UUID.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
14class BlockPos;
15class CompoundTag;
16class DataLoadHelper;
17class HashedString;
18class Mob;
19class Village;
20// clang-format on
21
22class DwellerComponent {
23public:
24 // DwellerComponent inner types define
25 enum class DwellingType : int {
26 VillageDwelling = 0,
27 Count = 1,
28 };
29
30public:
31 // member variables
32 // NOLINTBEGIN
33 ::ll::TypedStorage<1, 1, bool> mCanFindPOI;
34 ::ll::TypedStorage<1, 1, bool> mCanMigrate;
35 ::ll::TypedStorage<1, 1, bool> mHasJoinedDwelling;
36 ::ll::TypedStorage<1, 1, bool> mFixUpRole;
37 ::ll::TypedStorage<1, 1, bool> mRewardPlayersOnFirstFounding;
38 ::ll::TypedStorage<8, 48, ::HashedString> mPreferredProfession;
39 ::ll::TypedStorage<4, 4, int> mFirstFoundingReward;
40 ::ll::TypedStorage<4, 4, int> mUpdateIntervalVariant;
41 ::ll::TypedStorage<8, 8, uint64> mDwellingUpdateInterval;
42 ::ll::TypedStorage<8, 8, uint64> mUpdateIntervalBase;
43 ::ll::TypedStorage<4, 4, float> mDwellingBoundsTolerance;
44 ::ll::TypedStorage<4, 4, ::DwellerComponent::DwellingType> mType;
45 ::ll::TypedStorage<4, 4, ::DwellerRole> mRole;
46 ::ll::TypedStorage<8, 16, ::mce::UUID> mDwellingUniqueID;
47 // NOLINTEND
48
49public:
50 // member functions
51 // NOLINTBEGIN
52 MCAPI void DecrementDwellingUpdateInterval();
53
54 MCAPI DwellerComponent();
55
56 MCAPI ::DwellerRole _getRole(::std::string const& role) const;
57
58 MCAPI ::DwellerComponent::DwellingType _getType(::std::string const& type) const;
59
60 MCAPI bool _isLockedInToProfession(::Actor const& owner) const;
61
62 MCAPI void addAdditionalSaveData(::CompoundTag& tag, ::Actor const& owner) const;
63
64 MCAPI void checkandUpdateDwellingStatus(::Actor const& owner, ::Village* myVillage);
65
66 MCAPI void clearPreferredProfession();
67
68 MCAPI void fixupProfession(::Actor const& owner, ::Village* village);
69
70 MCFOLD bool getCanFindPOI() const;
71
72 MCFOLD ::DwellerRole getDwellerRole() const;
73
74 MCAPI ::mce::UUID getDwellingUniqueID() const;
75
76 MCFOLD uint64 getDwellingUpdateInterval() const;
77
78 MCFOLD bool getFixUpRole() const;
79
80 MCFOLD ::HashedString const& getPreferredProfession() const;
81
82 MCFOLD uint64 getUpdateIntervalBase() const;
83
84 MCFOLD int getUpdateIntervalVariant() const;
85
86 MCAPI ::std::weak_ptr<::Village> const getVillage(::Actor const& owner) const;
87
88 MCAPI ::BlockPos getVillageCenter(::Actor const& owner) const;
89
90 MCFOLD bool hasDwelling() const;
91
92 MCAPI bool hasPreferredProfession(::Actor const& owner) const;
93
94 MCAPI void initFromDefinition(::Actor& owner);
95
96 MCAPI bool isWithinRestriction(::Actor const& owner) const;
97
98 MCAPI bool needsToFixupJobSite(::Actor const& owner) const;
99
100 MCAPI bool needsToFixupProfession(::Actor const& owner) const;
101
102 MCAPI bool needsToFixupVillageRole(::Actor const& owner, ::Village* myVillage) const;
103
104 MCAPI void onDeath(::Actor& owner, ::ActorDamageSource const& source);
105
106 MCAPI void onDimensionChange(::Actor& owner);
107
108 MCAPI void onRemove(::Actor& owner);
109
110 MCAPI void readAdditionalSaveData(::Actor& owner, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
111
112 MCAPI void setDwellingUniqueID(::Actor& owner, ::mce::UUID id);
113
114 MCFOLD void setDwellingUpdateInterval(uint64 updateInterval);
115
116 MCFOLD void setFixUpRole(bool fixUpRole);
117
118 MCAPI void setLastHurtByMob(::Actor& owner, ::Mob* mob);
119
120 MCAPI bool trySetPreferredProfession(::Actor const& owner, ::HashedString const& poi);
121
122 MCAPI bool tryToFixupRole(::Actor const& owner, ::Village* village);
123
124 MCAPI bool tryToMigrate(::Actor& owner, ::Village* oldVillage, ::Village* newVillage);
125
126 MCAPI bool wantsToMigrate(::Actor const& owner, ::Village* myVillage) const;
127 // NOLINTEND
128
129public:
130 // static variables
131 // NOLINTBEGIN
132 MCAPI static ::std::unordered_map<::std::string, ::DwellerRole> const& DWELLING_ROLES();
133
134 MCAPI static ::std::unordered_map<::std::string, ::DwellerComponent::DwellingType> const& DWELLING_TYPES();
135 // NOLINTEND
136
137public:
138 // constructor thunks
139 // NOLINTBEGIN
140 MCAPI void* $ctor();
141 // NOLINTEND
142};
Definition ActorDamageSource.h:18
Definition Actor.h:125
Definition BlockPos.h:21
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition HashedString.h:5
Definition Mob.h:57
Definition Village.h:34
Definition UUID.h:7