22class DwellerComponent {
25 enum class DwellingType :
int {
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;
52 MCAPI
void DecrementDwellingUpdateInterval();
54 MCAPI DwellerComponent();
56 MCAPI ::DwellerRole _getRole(::std::string
const& role)
const;
58 MCAPI ::DwellerComponent::DwellingType _getType(::std::string
const& type)
const;
60 MCAPI
bool _isLockedInToProfession(
::Actor const& owner)
const;
64 MCAPI
void checkandUpdateDwellingStatus(
::Actor const& owner,
::Village* myVillage);
66 MCAPI
void clearPreferredProfession();
70 MCFOLD
bool getCanFindPOI()
const;
72 MCFOLD ::DwellerRole getDwellerRole()
const;
74 MCAPI ::mce::UUID getDwellingUniqueID()
const;
76 MCFOLD uint64 getDwellingUpdateInterval()
const;
78 MCFOLD
bool getFixUpRole()
const;
80 MCFOLD ::HashedString
const& getPreferredProfession()
const;
82 MCFOLD uint64 getUpdateIntervalBase()
const;
84 MCFOLD
int getUpdateIntervalVariant()
const;
86 MCAPI ::std::weak_ptr<::Village>
const getVillage(
::Actor const& owner)
const;
88 MCAPI ::BlockPos getVillageCenter(
::Actor const& owner)
const;
90 MCFOLD
bool hasDwelling()
const;
92 MCAPI
bool hasPreferredProfession(
::Actor const& owner)
const;
94 MCAPI
void initFromDefinition(
::Actor& owner);
96 MCAPI
bool isWithinRestriction(
::Actor const& owner)
const;
98 MCAPI
bool needsToFixupJobSite(
::Actor const& owner)
const;
100 MCAPI
bool needsToFixupProfession(
::Actor const& owner)
const;
102 MCAPI
bool needsToFixupVillageRole(
::Actor const& owner,
::Village* myVillage)
const;
106 MCAPI
void onDimensionChange(
::Actor& owner);
108 MCAPI
void onRemove(
::Actor& owner);
114 MCFOLD
void setDwellingUpdateInterval(uint64 updateInterval);
116 MCFOLD
void setFixUpRole(
bool fixUpRole);
118 MCAPI
void setLastHurtByMob(
::Actor& owner,
::Mob* mob);
126 MCAPI
bool wantsToMigrate(
::Actor const& owner,
::Village* myVillage)
const;
132 MCAPI static ::std::unordered_map<::std::string, ::DwellerRole>
const& DWELLING_ROLES();
134 MCAPI static ::std::unordered_map<::std::string, ::DwellerComponent::DwellingType>
const& DWELLING_TYPES();