ed_journals/modules/civilization/models/location_info.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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
use serde::{Deserialize, Serialize};
use crate::modules::civilization::{
Conflict, Economy, Faction, Government, Superpower, SystemSecurity, ThargoidWar,
};
use crate::modules::galaxy::BodyType;
/// Shared model for information about a given location.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct LocationInfo {
/// The name of the star system that is displayed to the player.
pub star_system: String,
/// The unique 'id' of the system.s
pub system_address: u64,
/// The position of the system in the galaxy. The origin is the Sol system.
pub star_pos: [f32; 3],
/// To which superpower the system is allied, if any.
pub system_alliance: Option<Superpower>,
/// The economy of the system. Unpopulated systems use [Economy::None] as value.
pub system_economy: Economy,
/// Localized string of the [system_economy] field. Prefer using the [Display] trait on the
/// [Economy] enum.
#[serde(rename = "SystemEconomy_Localised")]
pub system_economy_localized: Option<String>,
/// Second economy of the system, if any.
pub system_second_economy: Economy,
/// Localized string of the [system_second_economy] field.
#[serde(rename = "SystemSecondEconomy_Localised")]
pub system_second_economy_localized: Option<String>,
/// The primary government in the system.
pub system_government: Government,
/// The localized name of the primary government in the system.
#[serde(rename = "SystemGovernment_Localised")]
pub system_government_localized: Option<String>,
/// The level of security presence in the system.
pub system_security: SystemSecurity,
/// The localized name of the security presence in the system.
#[serde(rename = "SystemSecurity_Localised")]
pub system_security_localized: Option<String>,
/// The number of citizens that live in the system.
pub population: u64,
/// The name of the body the location refers to.
pub body: String,
/// The id of the body the location refers to.
#[serde(rename = "BodyID")]
pub body_id: u8,
/// The kind of body the location refers to.
pub body_type: BodyType,
/// A list of factions that are present in the system.
#[serde(default)]
pub factions: Vec<Faction>,
/// A list of conflicts/wars currently active in the system.
#[serde(default)]
pub conflicts: Vec<Conflict>,
/// Information about the state of the Thargoid war in the current system, if any.
pub thargoid_war: Option<ThargoidWar>,
// TODO include powerplay
}