Module stats

Module stats 

Source
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§

CharacterId
Thin wrapper that derefs to the inner type. Ideal for zero-overhead new-type patterns.
FactionId
Thin wrapper that derefs to the inner type. Ideal for zero-overhead new-type patterns.
GenericStat
Thin wrapper that derefs to the inner type. Ideal for zero-overhead new-type patterns.
MetaStats
Strategic context and meta-data for an entity.
OverallStats
Aggregated statistics for a single entity.
Position
A two-dimensional point on the world map.
PositionGrid
A grid-aligned position used for chunk look-ups.
StatPair
A generic stat pair with (ListStats, GenericStat), used mainly for clap Accepts two forms
SummaryStats
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.
TypedLink
A typed link between two entities.

Enums§

EntityType
The list of all types of entities
ListStats
Bridge between the CLI and the statistics logic.
Modification
A description of how a value should be updated.
PositionIdentifier
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.
GameStat
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