pub struct Needs<'a, 'b> {Show 18 fields
pub town: &'a TownView<'b>,
pub sectors: &'a mut SectorGraph,
pub sites: &'a [StorageSite],
pub storages: &'a mut [Storage],
pub materials: &'a [RawMaterial],
pub homes: &'a mut BTreeMap<usize, Home>,
pub residences: &'a [usize],
pub temperature: f32,
pub life: &'a LifeRules,
pub carry: i32,
pub terrain: &'a HeightGrid<'b>,
pub size: usize,
pub rng: &'a mut Random,
pub healers: &'a [usize],
pub workplaces: &'a BTreeMap<usize, WorkPlace>,
pub attendance: &'a mut BTreeMap<usize, Attendance>,
pub citizens: &'a [Citizen],
pub reschool: bool,
}Expand description
What the activities read and change besides the citizen.
Fields§
§town: &'a TownView<'b>A view of the town.
sectors: &'a mut SectorGraphThe sector graph.
sites: &'a [StorageSite]The storage sites.
storages: &'a mut [Storage]The town’s storages.
materials: &'a [RawMaterial]The raw materials.
homes: &'a mut BTreeMap<usize, Home>The homes, by entity.
residences: &'a [usize]The town’s residences, in the order they were completed: the searches over residences keep the first of equal ranks.
Original: FUN_140093840, FUN_140094140.
temperature: f32The environment’s temperature.
life: &'a LifeRulesThe citizen description’s rules.
carry: i32The laborer profession’s carry.
terrain: &'a HeightGrid<'b>The ground’s heights.
size: usizeThe map’s size in cells.
rng: &'a mut RandomThe game’s random numbers.
healers: &'a [usize]The town’s HealerComponents.
workplaces: &'a BTreeMap<usize, WorkPlace>Every WorkPlaceComponent, by entity.
attendance: &'a mut BTreeMap<usize, Attendance>The AttendanceComponents, by entity.
citizens: &'a [Citizen]Every citizen (play follows the guardian).
reschool: boolSet when the school activity found no place to sit: the caller leaves the school and looks for another.
Original: FUN_14011af20(c, 1).
Implementations§
Source§impl Needs<'_, '_>
impl Needs<'_, '_>
Sourcepub fn eat(&mut self, who: &mut Who<'_>) -> bool
pub fn eat(&mut self, who: &mut Who<'_>) -> bool
Activities 0 and 14: eat, at home or from a storage.
Original: FUN_140112250.
Sourcepub fn warm(&mut self, who: &mut Who<'_>) -> bool
pub fn warm(&mut self, who: &mut Who<'_>) -> bool
Activities 1 and 15: get warm, at the nearest warm residence when the citizen is very cold, else at a warm home.
Original: FUN_140112790.
Sourcepub fn stock_home(
&mut self,
who: &mut Who<'_>,
fuel: bool,
reachable: bool,
) -> bool
pub fn stock_home( &mut self, who: &mut Who<'_>, fuel: bool, reachable: bool, ) -> bool
Activities 6 (food) and 7 (firewood, when fuel): carry food or firewood home from the
nearest storage. The caller first drops off anything carried (and queues this activity
again). reachable is the caller’s test that the home can be reached.
Original: FUN_140111160 (food), FUN_1401108b0 (firewood); the reach test is
FUN_14011ada0.
Source§impl Needs<'_, '_>
impl Needs<'_, '_>
Sourcepub fn school(&mut self, who: &mut Who<'_>) -> bool
pub fn school(&mut self, who: &mut Who<'_>) -> bool
Activity 10: sit a lesson at the school (message 4; its length is a value of the citizen description).
Original: FUN_140112a30.
Sourcepub fn doctor(&mut self, who: &mut Who<'_>, me: usize) -> bool
pub fn doctor(&mut self, who: &mut Who<'_>, me: usize) -> bool
Activity 5: with a doctor, be treated (message 5); without one, or when the doctor cannot be reached, rest at a home that can be reached. Like the original, it reports “not started” after a treatment visit.
Original: FUN_140112c60.