pub struct CitizenState {Show 40 fields
pub health: f32,
pub happiness: f32,
pub hunger: f32,
pub cold: f32,
pub sick: bool,
pub work: Option<usize>,
pub status: u32,
pub tool_status: i32,
pub tool_uses: i32,
pub clothing_status: i32,
pub clothing: i32,
pub clothing_remaining: i64,
pub health_events: u32,
pub flags: u32,
pub supply_activity: i32,
pub job: i32,
pub home: Option<usize>,
pub carried: Storage,
pub profession: usize,
pub workplace: Option<usize>,
pub shown_tool: i32,
pub home_slot: i32,
pub reproduction: f32,
pub health_timer: i64,
pub happiness_timer: i64,
pub foods: Vec<usize>,
pub dependents: Vec<usize>,
pub school_time: i64,
pub school: Option<usize>,
pub doctor: Option<usize>,
pub priest: Option<usize>,
pub disease: Option<usize>,
pub disease_left: i64,
pub immunity: i64,
pub spread: i64,
pub disease_clock: i64,
pub field_84: i32,
pub schooled: bool,
pub accident: Option<usize>,
pub accident_timer: i64,
}Expand description
Citizen fields read/written by equipment activities and Citizen messages 1/6/7.
Fields§
§health: f32The health.
happiness: f32The happiness.
hunger: f32The hunger.
cold: f32The cold.
sick: boolWhether the citizen is sick.
work: Option<usize>The work it is assigned, if any (inferred).
status: u32StatusIconComponent (Citizen points to that component).
tool_status: i32The tool level shown in the citizen window.
tool_uses: i32The uses left on its tool.
clothing_status: i32The clothing level shown in the citizen window.
clothing: i32The clothing level: 0 none, 1 or 2.
clothing_remaining: i64The time its clothing lasts.
health_events: u32Flags of health events.
flags: u32Status flags.
supply_activity: i32The supply errand it runs for its home: 1 food, 2 firewood.
job: i32The id of the work it does (−1 none).
home: Option<usize>The home, if any.
carried: StorageWhat it carries.
profession: usizeProfession (index into the profession list).
workplace: Option<usize>Workplace entity.
shown_tool: i32The tool ShowTool attached (−1 none, −2 carried goods).
home_slot: i32Family slot in the home’s ResidenceComponent (−1 none).
reproduction: f32Pregnancy (positive, counting down) or the wait after a birth (negative).
health_timer: i64Time towards the next health step.
happiness_timer: i64Time towards the next happiness step.
foods: Vec<usize>Every kind of food eaten.
dependents: Vec<usize>The children and other dependents, in ring order.
school_time: i64Time attending school.
school: Option<usize>The school’s AttendanceComponent entity (Citizen::school mirrors it).
doctor: Option<usize>The doctor’s AttendanceComponent entity.
priest: Option<usize>The chapel’s AttendanceComponent entity.
disease: Option<usize>The disease (index into the disease list).
disease_left: i64The illness left while sick.
immunity: i64The immunity left after an illness.
spread: i64Time to the next spread attempt.
disease_clock: i64Time since the last disease check.
field_84: i32The work count the happiness compares with _workForHappiness; never written in 1.0.7, so
0.
schooled: boolHas had a school place.
accident: Option<usize>The profession whose work it had an accident at.
Original: FUN_14011bb20.
accident_timer: i64Time since the last injury check.
Implementations§
Source§impl CitizenState
impl CitizenState
Sourcepub fn newborn(rules: &LifeRules) -> CitizenState
pub fn newborn(rules: &LifeRules) -> CitizenState
The state of a new citizen.
Original: FUN_140119c40, set-up FUN_140119520.
Source§impl CitizenState
impl CitizenState
Sourcepub fn message(&mut self, m: Message, rules: CitizenRulesAi)
pub fn message(&mut self, m: Message, rules: CitizenRulesAi)
Handle a message about equipment (a tool or clothing given, worn out or used).
Original: the equipment branches of FUN_140117730 and FUN_1401152b0.
Trait Implementations§
Source§impl Clone for CitizenState
impl Clone for CitizenState
Source§fn clone(&self) -> CitizenState
fn clone(&self) -> CitizenState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more