refactor: the villager Poi enum lives in poi_sections.rs
World's POI sections are typed by mobs::villager_brain::Poi, which made world depend on mobs, one of the edges that keep the client lib in a single cycle. The enum moves to poi_sections.rs; villager_brain re-exports it and keeps its methods. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -789,14 +789,7 @@ pub fn golem_detected(m: &mut Mob, now: i64) {
|
|||||||
|
|
||||||
// ---- Behaviours ---------------------------------------------------------
|
// ---- Behaviours ---------------------------------------------------------
|
||||||
|
|
||||||
/// The POI types villagers use.
|
pub use crate::poi_sections::Poi;
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
||||||
pub enum Poi {
|
|
||||||
/// A job site, by profession index.
|
|
||||||
Job(u8),
|
|
||||||
Home,
|
|
||||||
Meeting,
|
|
||||||
}
|
|
||||||
impl Poi {
|
impl Poi {
|
||||||
fn max_tickets(self) -> usize {
|
fn max_tickets(self) -> usize {
|
||||||
match self {
|
match self {
|
||||||
|
|||||||
@@ -79,6 +79,15 @@ impl<T: Copy> PoiSections<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The POI types villagers use.
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
|
pub enum Poi {
|
||||||
|
/// A job site, by profession index.
|
||||||
|
Job(u8),
|
||||||
|
Home,
|
||||||
|
Meeting,
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ pub struct World {
|
|||||||
/// (`ChunkHolder.sectionLightChanged`).
|
/// (`ChunkHolder.sectionLightChanged`).
|
||||||
pub light_log: Option<crate::fast_hash::FxHashMap<(i32, i32), u32>>,
|
pub light_log: Option<crate::fast_hash::FxHashMap<(i32, i32), u32>>,
|
||||||
/// The villager POIs of each section (`PoiManager`'s sections).
|
/// The villager POIs of each section (`PoiManager`'s sections).
|
||||||
pub pois: crate::poi_sections::PoiSections<crate::mobs::villager_brain::Poi>,
|
pub pois: crate::poi_sections::PoiSections<crate::poi_sections::Poi>,
|
||||||
/// Moving-piston states removed during the last tick; retained until the
|
/// Moving-piston states removed during the last tick; retained until the
|
||||||
/// final block mesh is visible.
|
/// final block mesh is visible.
|
||||||
pub moving_piston_fallback: Vec<([i32; 3], horizon_world::piston_shape::MovingPistonState)>,
|
pub moving_piston_fallback: Vec<([i32; 3], horizon_world::piston_shape::MovingPistonState)>,
|
||||||
|
|||||||
Reference in New Issue
Block a user