37 enum class BedAvailabilityState :
int {
47 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Village>> village;
48 ::ll::TypedStorage<1, 1, bool> positionIsWithinVillageBounds;
49 ::ll::TypedStorage<4, 4, float> distanceToClosestEdgeOfVillage;
57 ::ll::TypedStorage<4, 4, ::VillageManager::BedAvailabilityState> bedAvailability;
61 using POIBlueprintMap = ::std::unordered_map<::BlockType const*, ::std::unique_ptr<::POIBlueprint>>;
63 using POIMap = ::std::unordered_map<::BlockPos, ::std::shared_ptr<::POIInstance>>;
65 using VillageMap = ::std::unordered_map<::mce::UUID, ::std::shared_ptr<::Village>>;
70 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
71 ::ll::TypedStorage<8, 40, ::std::deque<::ActorUniqueID>> mFindPOIQueries;
72 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::POIInstance>>> mUnclusteredPOIs;
73 ::ll::TypedStorage<8, 64, ::std::unordered_map<::mce::UUID, ::std::shared_ptr<::Village>>> mVillages;
74 ::ll::TypedStorage<8, 192, ::std::array<::std::unordered_map<::BlockPos, ::std::shared_ptr<::POIInstance>>, 3>>
76 ::ll::TypedStorage<8, 64, ::std::unordered_map<::BlockType const*, ::std::unique_ptr<::POIBlueprint>>>
78 ::ll::TypedStorage<8, 8, ::Tick> mTickCount;
79 ::ll::TypedStorage<8, 32, ::WanderingTraderScheduler> mWanderingTraderScheduler;
80 ::ll::TypedStorage<1, 1, bool> mFinishedQueryScan;
81 ::ll::TypedStorage<4, 4, int> mCurrentXScan;
82 ::ll::TypedStorage<4, 4, int> mCurrentYScan;
83 ::ll::TypedStorage<4, 4, int> mCurrentZScan;
84 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSaveSubscription;
85 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnLevelStorageManagerStartLeaveGameSubscription;
90 VillageManager& operator=(VillageManager
const&);
91 VillageManager(VillageManager
const&);
97 virtual ~VillageManager() =
default;
99 virtual ::std::weak_ptr<::Village>
100 fetchClosestVillage(
::BlockPos const& position,
int maxDistFromVillageBounds, uint searchRadius)
const ;
102 virtual ::std::weak_ptr<::Village> getVillageByID(
::mce::UUID const& villageID)
const ;
108 MCAPI
explicit VillageManager(
::Dimension& dimension);
110 MCAPI
void _assignPOIOnly(::std::shared_ptr<::POIInstance>&& pi);
113 MCAPI
void _clusterPOIs();
116 MCAPI
void _loadPOIBlueprints();
118 MCAPI
void _processNextUnclusteredPOIQuery();
120 MCAPI
void _removeEligibleVillages();
124 MCAPI
void _tryAssignPOIOrCreateVillage(::std::shared_ptr<::POIInstance>&& pi);
126 MCAPI ::std::weak_ptr<::Village> fetchClosestVillageMostSuitableForDweller(
128 int maxDistFromVillageBounds,
132 MCAPI ::std::weak_ptr<::Village> getClosestVillageWithRaid(
::BlockPos const& pos);
144 MCAPI
void tick(
::Tick const& tick);
159 MCAPI ::std::weak_ptr<::Village>
160 $fetchClosestVillage(
::BlockPos const& position,
int maxDistFromVillageBounds, uint searchRadius)
const;
162 MCAPI ::std::weak_ptr<::Village> $getVillageByID(
::mce::UUID const& villageID)
const;