pub struct OverallStats {Show 20 fields
pub demographics: GenericStat,
pub population: GenericStat,
pub growth_rate: GenericStat,
pub crime: GenericStat,
pub happiness: GenericStat,
pub economy: GenericStat,
pub food: GenericStat,
pub industry: GenericStat,
pub science: GenericStat,
pub trade: GenericStat,
pub military: GenericStat,
pub army: GenericStat,
pub strength: GenericStat,
pub fortification: GenericStat,
pub threat: GenericStat,
pub infrastructure: GenericStat,
pub bureaucracy: GenericStat,
pub transportation: GenericStat,
pub sprawl: GenericStat,
pub health: GenericStat,
}Expand description
Aggregated statistics for a single entity.
The struct is intentionally flat to keep access fast; the fields are logically grouped by comment blocks that describe each thematic section.
Fields§
§demographics: GenericStatTotal economic health of the entity.
Purpose - A single value summarizing all economic indicators.
Effect - Drives tax revenue, spending power, and overall economic influence.
Source - Sum of industry, science, trade, and other economic contributors.
population: GenericStatPopulation count.
Purpose - The number of citizens living in the entity. Effect - Determines resource consumption, tax base, and potential unrest. Source - Updated by the growth/decay formulas each turn.
growth_rate: GenericStatPer-turn change in population.
Purpose - The growth rate of the population.
Effect - Predicts future needs and signals potential social unrest.
Source - Derived from population, happiness, and stability.
crime: GenericStatCrime level (0-1 scale).
Purpose - How frequently crimes occur. Effect - Can trigger riots and reduce stability. Source - Result of the crime function (influenced by class disparity and law enforcement).
happiness: GenericStatBase happiness of the population (0-1 scale).
Purpose - A measure of citizen contentment. Effect - Influences productivity, tax compliance, and unrest. Source - Output of the happiness function (affected by class, war, infrastructure).
economy: GenericStatAggregate economic health of the entity.
Purpose - A single value summarizing all economic metrics.
Effect - Drives revenue, spending, and empire-wide economic influence.
Source - Sum of food, industry, science, trade, etc.
food: GenericStatFood produced by the entity.
Purpose - Amount of consumable resources available.
Effect - Keeps the population alive and productive.
Source - food = farm_yield + tech_level.
industry: GenericStatStrength of the industry.
Purpose - Industrial production capacity.
Effect - Drives tax revenue and unit production.
Source - industry = factory_output + tech_level.
science: GenericStatScientific output.
Purpose - Rate of research progress.
Effect - Determines how quickly new technologies are unlocked.
Source - science = research_center_output + tech_level.
trade: GenericStatTrade volume / exports.
Purpose - Measure of export activity.
Effect - Influences influence and wealth.
Source - trade = trade_network_output.
military: GenericStatOverall military power.
Purpose - Composite measure of combat capability.
Effect - Determines defensive and offensive strength.
Source - Sum of army, strength, fortification, etc.
army: GenericStatNumber of battle-ready units.
Purpose - Size of the active army. Effect - Directly dictates defense and attack potential. Source - Sum of all trained and equipped units.
strength: GenericStatComposite strength of the army.
Purpose - Tech, training, and equipment bonuses aggregated.
Effect - Determines combat effectiveness and required force to defeat an enemy.
Source - strength = Σ(unit_strength) x tech_bonus x training_bonus.
fortification: GenericStatDefensive bonus from fortifications.
Purpose - Wall and tower defenses.
Effect - Adds a multiplier to overall defense.
Source - fortification = Σ(fortification_building_bonus).
threat: GenericStatThreat level facing the entity.
Purpose - Likelihood of being attacked.
Effect - Triggers early warning alerts and strategic decisions.
Source - threat = (enemy_proximity + enemy_strength) / defense.
infrastructure: GenericStatTotal infrastructure power.
Purpose - Overall built-environment capacity. Effect - Supports population size and efficiency. Source - Sum of all infrastructure components.
bureaucracy: GenericStatBureaucratic power.
Purpose - Efficiency of the city’s administrative machinery.
Effect - Improves resource management and policy implementation.
Source - bureaucracy = Σ(bureaucracy_building_output).
transportation: GenericStatTransportation level.
Purpose - Availability and quality of transport infrastructure.
Effect - Impacts logistics, mobility, and trade.
Source - transportation = Σ(transport_building_output).
sprawl: GenericStatSprawl / urban density.
Purpose - Measure of city sprawl and clutter.
Effect - Affects health, happiness, and infrastructure efficiency.
Source - sprawl = Σ(sprawl_factor).
health: GenericStatHealth infrastructure quality.
Purpose - Public health capacity.
Effect - Affects population health and can generate unrest.
Source - health = output_of_health_function (influenced by sanitation, disease spread, etc.).
Implementations§
Source§impl OverallStats
impl OverallStats
Sourcepub fn get_field(&self, field: &ListStats) -> &GenericStat
pub fn get_field(&self, field: &ListStats) -> &GenericStat
Retrieve a reference to a statistic field by its ListStats key.
§Arguments
field- TheListStatsvariant that selects which statistic to return.
§Returns
A reference to the selected GenericStat.
§Panics
Panics if field is one of the variants that are not yet implemented
(Social, Culture, Education, Tourism, Influence).
Sourcepub fn get_field_mut(&mut self, field: &ListStats) -> &mut GenericStat
pub fn get_field_mut(&mut self, field: &ListStats) -> &mut GenericStat
Retrieve a mutable reference to a statistic field by its ListStats key.
§Arguments
field- TheListStatsvariant that selects which statistic to modify.
§Returns
A mutable reference to the selected GenericStat.
§Panics
Panics if field is one of the variants that are not yet implemented
(Social, Culture, Education, Tourism, Influence).
Source§impl OverallStats
impl OverallStats
Trait Implementations§
Source§impl Add for OverallStats
impl Add for OverallStats
Source§impl Clone for OverallStats
impl Clone for OverallStats
Source§fn clone(&self) -> OverallStats
fn clone(&self) -> OverallStats
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OverallStats
impl Debug for OverallStats
Source§impl Default for OverallStats
impl Default for OverallStats
Source§fn default() -> OverallStats
fn default() -> OverallStats
Source§impl<'de> Deserialize<'de> for OverallStats
impl<'de> Deserialize<'de> for OverallStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<OverallStats> for SummaryStats
impl From<OverallStats> for SummaryStats
Source§fn from(value: OverallStats) -> Self
fn from(value: OverallStats) -> Self
Source§impl Row for &OverallStats
impl Row for &OverallStats
Source§impl Row for OverallStats
impl Row for OverallStats
Source§impl Serialize for OverallStats
impl Serialize for OverallStats
Source§impl Sub for OverallStats
impl Sub for OverallStats
Source§impl Symbols for OverallStats
impl Symbols for OverallStats
Auto Trait Implementations§
impl Freeze for OverallStats
impl RefUnwindSafe for OverallStats
impl Send for OverallStats
impl Sync for OverallStats
impl Unpin for OverallStats
impl UnwindSafe for OverallStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more