solar_system
Data model and query module for the solar-system layer: planets, moons, and asteroids.
tiargus.solar_system
Data model and SavegameModule for the solar-system layer.
The solar-system layer describes the physical bodies of the Sol system — planets, moons, and asteroids — independent of the colonisation entities (hab sites, bases, modules) that sit on top of them in habs.
Provides:
SpaceBody— a planet, moon, or asteroid.SpaceBodyModule(key:"space_bodies") — parses every body from the save and exposes them keyed by game-state ID.
SpaceBody
dataclass
A planet, moon, or asteroid present in the save file.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Numeric game-state ID used as a foreign key by other entities. |
display_name |
str
|
Human-readable name shown in-game (e.g. |
template_name |
str
|
Internal template identifier used to look up the
region label in the bundled location map (e.g.
|
max_hab_tier |
int
|
Maximum hab tier (1–3) that can be built on this body. |
barycenter_id |
Optional[int]
|
ID of the body this one orbits (its barycenter), or
|
Source code in src/tiargus/solar_system.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
SpaceBodyModule
Bases: SavegameModule
Parses every planet, moon, and asteroid from the save.
Provides display names and template names used by other modules to build location labels and resolve body references.
Source code in src/tiargus/solar_system.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
space_bodies
property
All space bodies keyed by their numeric game-state ID.
__init_subclass__(**kwargs)
Register subclasses in _REGISTRY at definition time.
Raises:
| Type | Description |
|---|---|
TypeError
|
If a subclass does not define |
Source code in src/tiargus/savegame.py
141 142 143 144 145 146 147 148 149 150 | |
requires()
classmethod
Return the KEYs of modules that must be parsed before this one.
Override this in subclasses that need data from other modules.
TerraInvictaSave resolves and parses all declared dependencies
(and their transitive dependencies) before calling parse() on this
module.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of |
list[str]
|
empty list (no dependencies). |
Source code in src/tiargus/savegame.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |