Skip to content
LeviMC
English
AutoLightDark
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
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 MCNAPI bool _isLockedInToProfession(::Actor const& owner) const;
53
54 MCNAPI void addAdditionalSaveData(::CompoundTag& tag, ::Actor const& owner) const;
55
56 MCNAPI void fixupProfession(::Actor const& owner, ::Village* village);
57
58 MCNAPI ::std::weak_ptr<::Village> const getVillage(::Actor const& owner) const;
59
60 MCNAPI ::BlockPos getVillageCenter(::Actor const& owner) const;
61
62 MCNAPI bool hasPreferredProfession(::Actor const& owner) const;
63
64 MCNAPI void initFromDefinition(::Actor& owner);
65
66 MCNAPI bool isWithinRestriction(::Actor const& owner) const;
67
68 MCNAPI bool needsToFixupJobSite(::Actor const& owner) const;
69
70 MCNAPI bool needsToFixupProfession(::Actor const& owner) const;
71
72 MCNAPI void onDeath(::Actor& owner, ::ActorDamageSource const& source);
73
74 MCNAPI void onRemove(::Actor& owner);
75
76 MCNAPI void readAdditionalSaveData(::Actor& owner, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
77
78 MCNAPI void setDwellingUniqueID(::Actor& owner, ::mce::UUID id);
79
80 MCNAPI void setLastHurtByMob(::Actor& owner, ::Mob* mob);
81
82 MCNAPI bool trySetPreferredProfession(::Actor const& owner, ::HashedString const& poi);
83
84 MCNAPI bool tryToFixupRole(::Actor const& owner, ::Village* village);
85
86 MCNAPI bool tryToMigrate(::Actor& owner, ::Village* oldVillage, ::Village* newVillage);
87 // NOLINTEND
88
89public:
90 // static variables
91 // NOLINTBEGIN
92 MCNAPI static ::std::unordered_map<::std::string, ::DwellerRole> const& DWELLING_ROLES();
93
94 MCNAPI static ::std::unordered_map<::std::string, ::DwellerComponent::DwellingType> const& DWELLING_TYPES();
95 // NOLINTEND
96};
Definition ActorDamageSource.h:18
Definition Actor.h:116
Definition BlockPos.h:14
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
Definition DwellerComponent.h:22
MCAPI bool needsToFixupProfession(::Actor const &owner) const
MCAPI bool hasPreferredProfession(::Actor const &owner) const
MCAPI void initFromDefinition(::Actor &owner)
MCAPI bool tryToMigrate(::Actor &owner, ::Village *oldVillage, ::Village *newVillage)
MCAPI void setLastHurtByMob(::Actor &owner, ::Mob *mob)
MCAPI void onDeath(::Actor &owner, ::ActorDamageSource const &source)
MCAPI void setDwellingUniqueID(::Actor &owner, ::mce::UUID id)
MCAPI::BlockPos getVillageCenter(::Actor const &owner) const
MCAPI void onRemove(::Actor &owner)
MCAPI ::std::weak_ptr<::Village > const getVillage(::Actor const &owner) const
MCAPI bool needsToFixupJobSite(::Actor const &owner) const
MCAPI bool isWithinRestriction(::Actor const &owner) const
MCAPI bool trySetPreferredProfession(::Actor const &owner, ::HashedString const &poi)
MCAPI void addAdditionalSaveData(::CompoundTag &tag, ::Actor const &owner) const
MCAPI void fixupProfession(::Actor const &owner, ::Village *village)
MCAPI bool tryToFixupRole(::Actor const &owner, ::Village *village)
static MCAPI ::std::unordered_map<::std::string, ::DwellerRole > const & DWELLING_ROLES()
MCAPI void readAdditionalSaveData(::Actor &owner, ::CompoundTag const &tag, ::DataLoadHelper &dataLoadHelper)
static MCAPI ::std::unordered_map<::std::string, ::DwellerComponent::DwellingType > const & DWELLING_TYPES()
MCAPI bool _isLockedInToProfession(::Actor const &owner) const
Definition HashedString.h:5
Definition Mob.h:58
Definition Village.h:31
Definition UUID.h:8