space_traders/models/
ship_frame.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// The frame of the ship. The frame determines the number of modules and mounting points of the ship, as well as base fuel capacity. As the condition of the frame takes more wear, the ship will become more sluggish and less maneuverable.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ShipFrame {
10    /// Symbol of the frame.
11    #[serde(rename = "symbol")]
12    pub symbol: Symbol,
13    /// Name of the frame.
14    #[serde(rename = "name")]
15    pub name: String,
16    /// Description of the frame.
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 slots that can be dedicated to modules installed in the ship. Each installed module take up a number of slots, and once there are no more slots, no new modules can be installed.
23    #[serde(rename = "moduleSlots")]
24    pub module_slots: u32,
25    /// The amount of slots that can be dedicated to mounts installed in the ship. Each installed mount takes up a number of points, and once there are no more points remaining, no new mounts can be installed.
26    #[serde(rename = "mountingPoints")]
27    pub mounting_points: u32,
28    /// The maximum amount of fuel that can be stored in this ship. When refueling, the ship will be refueled to this amount.
29    #[serde(rename = "fuelCapacity")]
30    pub fuel_capacity: u32,
31    #[serde(rename = "requirements")]
32    pub requirements: crate::models::ShipRequirements,
33}
34
35impl ShipFrame {
36    /// Create value with optional fields set to `None`.
37    #[allow(clippy::too_many_arguments)]
38    pub fn new(
39        symbol: Symbol,
40        name: String,
41        description: String,
42        module_slots: u32,
43        mounting_points: u32,
44        fuel_capacity: u32,
45        requirements: crate::models::ShipRequirements,
46    ) -> ShipFrame {
47        ShipFrame {
48            symbol,
49            name,
50            description,
51            condition: None,
52            module_slots,
53            mounting_points,
54            fuel_capacity,
55            requirements,
56        }
57    }
58}
59
60/// Symbol of the frame.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Symbol {
63    #[serde(rename = "FRAME_PROBE")]
64    Probe,
65    #[serde(rename = "FRAME_DRONE")]
66    Drone,
67    #[serde(rename = "FRAME_INTERCEPTOR")]
68    Interceptor,
69    #[serde(rename = "FRAME_RACER")]
70    Racer,
71    #[serde(rename = "FRAME_FIGHTER")]
72    Fighter,
73    #[serde(rename = "FRAME_FRIGATE")]
74    Frigate,
75    #[serde(rename = "FRAME_SHUTTLE")]
76    Shuttle,
77    #[serde(rename = "FRAME_EXPLORER")]
78    Explorer,
79    #[serde(rename = "FRAME_MINER")]
80    Miner,
81    #[serde(rename = "FRAME_LIGHT_FREIGHTER")]
82    LightFreighter,
83    #[serde(rename = "FRAME_HEAVY_FREIGHTER")]
84    HeavyFreighter,
85    #[serde(rename = "FRAME_TRANSPORT")]
86    Transport,
87    #[serde(rename = "FRAME_DESTROYER")]
88    Destroyer,
89    #[serde(rename = "FRAME_CRUISER")]
90    Cruiser,
91    #[serde(rename = "FRAME_CARRIER")]
92    Carrier,
93}
94
95impl Default for Symbol {
96    fn default() -> Symbol {
97        Self::Probe
98    }
99}