Expand description
Module that holds all statistics for an entity and the helper methods that operate on them.
The statistics are grouped into thematic sections (Demographics, Economy, Social, Military,
Infrastructure). Each field is a GenericStat, an internal wrapper around a numeric value
that provides convenience methods such as max(), clamp(), and arithmetic ops.
The documentation for each field follows the same three-part template:
- Purpose - What the stat represents.
- Effect - Gameplay consequence of the stat.
- Source - Formula or function that generates the stat value.
Structs§
- Character
Id - Thin wrapper that derefs to the inner type. Ideal for zero-overhead new-type patterns.
- Faction
Id - Thin wrapper that derefs to the inner type. Ideal for zero-overhead new-type patterns.
- Generic
Stat - Thin wrapper that derefs to the inner type. Ideal for zero-overhead new-type patterns.
- Meta
Stats - Strategic context and meta-data for an entity.
- Overall
Stats - Aggregated statistics for a single entity.
- Position
- A two-dimensional point on the world map.
- Position
Grid - A grid-aligned position used for chunk look-ups.
- Stat
Pair - A generic stat pair with (ListStats, GenericStat), used mainly for clap Accepts two forms
- Summary
Stats - A summary of the stats, only for display purposes
- TownId
- Thin wrapper that derefs to the inner type. Ideal for zero-overhead new-type patterns.
- Typed
Link - A typed link between two entities.
Enums§
- Entity
Type - The list of all types of entities
- List
Stats - Bridge between the CLI and the statistics logic.
- Modification
- A description of how a value should be updated.
- Position
Identifier - Represents a position that can be identified in three different ways.
- Reach
- The reach of the entity
- Role
- Semantic role of a link.
Traits§
- Accessible
- Trait for objects that can expose a stat via a string key. The trait returns a boxed trait object so callers do not need to know the concrete type that was stored.
- Game
Stat - A stat is a game value that can be converted to two different normalised ranges - a 100-point range for “gaming” logic and a 10-point range for “roll & UI” logic. The trait also exposes the underlying raw value and its visibility.
- Symbols
- Trait to implement some symbol representations