space_traders/models/
ship_reactor.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// The reactor of the ship. The reactor is responsible for powering the ship's systems and weapons.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ShipReactor {
10    /// Symbol of the reactor.
11    #[serde(rename = "symbol")]
12    pub symbol: Symbol,
13    /// Name of the reactor.
14    #[serde(rename = "name")]
15    pub name: String,
16    /// Description of the reactor.
17    #[serde(rename = "description")]
18    pub description: String,
19    /// Condition is a range of 0 to 100 where 0 is completely worn out and 100 is brand new.
20    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
21    pub condition: Option<u32>,
22    /// The amount of power provided by this reactor. The more power a reactor provides to the ship, the lower the cooldown it gets when using a module or mount that taxes the ship's power.
23    #[serde(rename = "powerOutput")]
24    pub power_output: u32,
25    #[serde(rename = "requirements")]
26    pub requirements: crate::models::ShipRequirements,
27}
28
29impl ShipReactor {
30    /// Create value with optional fields set to `None`.
31    #[allow(clippy::too_many_arguments)]
32    pub fn new(
33        symbol: Symbol,
34        name: String,
35        description: String,
36        power_output: u32,
37        requirements: crate::models::ShipRequirements,
38    ) -> ShipReactor {
39        ShipReactor {
40            symbol,
41            name,
42            description,
43            condition: None,
44            power_output,
45            requirements,
46        }
47    }
48}
49
50/// Symbol of the reactor.
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum Symbol {
53    #[serde(rename = "REACTOR_SOLAR_I")]
54    SolarI,
55    #[serde(rename = "REACTOR_FUSION_I")]
56    FusionI,
57    #[serde(rename = "REACTOR_FISSION_I")]
58    FissionI,
59    #[serde(rename = "REACTOR_CHEMICAL_I")]
60    ChemicalI,
61    #[serde(rename = "REACTOR_ANTIMATTER_I")]
62    AntimatterI,
63}
64
65impl Default for Symbol {
66    fn default() -> Symbol {
67        Self::SolarI
68    }
69}