pub struct Statistics {
pub series: Vec<Vec<i32>>,
pub timer: i64,
}Expand description
The Town Info graphs’ history (StockManager) and the time to the next sample.
Fields§
§series: Vec<Vec<i32>>The history of each graph.
timer: i64The time to the next sample.
Implementations§
Source§impl Statistics
impl Statistics
Sourcepub fn update(
&mut self,
dt: i64,
citizens: &[CitizenSample],
health_max: f32,
happiness_max: f32,
stock: &[i32; 21],
counters: &mut StockCounters,
) -> bool
pub fn update( &mut self, dt: i64, citizens: &[CitizenSample], health_max: f32, happiness_max: f32, stock: &[i32; 21], counters: &mut StockCounters, ) -> bool
The timer counts down dt; below 1 a sample is taken and the next is 75 s off.
Original: FUN_14008fc00, FUN_140091780 (sampling).
Sourcepub fn sample(
&mut self,
citizens: &[CitizenSample],
health_max: f32,
happiness_max: f32,
stock: &[i32; 21],
counters: &mut StockCounters,
)
pub fn sample( &mut self, citizens: &[CitizenSample], health_max: f32, happiness_max: f32, stock: &[i32; 21], counters: &mut StockCounters, )
The population (all, adults, students, children), the average health and happiness and the share educated (of the adults) and with coats, in percent; each stock slot’s count, used and made; then the used and made counts restart.
Original: FUN_14008fc00.
Trait Implementations§
Source§impl Clone for Statistics
impl Clone for Statistics
Source§fn clone(&self) -> Statistics
fn clone(&self) -> Statistics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Statistics
impl Debug for Statistics
Source§impl Default for Statistics
impl Default for Statistics
impl Eq for Statistics
Source§impl PartialEq for Statistics
impl PartialEq for Statistics
impl StructuralPartialEq for Statistics
Auto Trait Implementations§
impl Freeze for Statistics
impl RefUnwindSafe for Statistics
impl Send for Statistics
impl Sync for Statistics
impl Unpin for Statistics
impl UnsafeUnpin for Statistics
impl UnwindSafe for Statistics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more