space_traders_api/models/
ship_mount.rs

1/*
2 * SpaceTraders API
3 *
4 * SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer universe.  The API is documented using [OpenAPI](https://github.com/SpaceTradersAPI/api-docs). You can send your first request right here in your browser to check the status of the game server.  ```json http {   \"method\": \"GET\",   \"url\": \"https://api.spacetraders.io/v2\", } ```  Unlike a traditional game, SpaceTraders does not have a first-party client or app to play the game. Instead, you can use the API to build your own client, write a script to automate your ships, or try an app built by the community.  We have a [Discord channel](https://discord.com/invite/jh6zurdWk5) where you can share your projects, ask questions, and get help from other players.   
5 *
6 * The version of the OpenAPI document: 2.3.0
7 * Contact: joel@spacetraders.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ShipMount : A mount is installed on the exterier of a ship.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ShipMount {
17    /// Symbo of this mount.
18    #[serde(rename = "symbol")]
19    pub symbol: Symbol,
20    /// Name of this mount.
21    #[serde(rename = "name")]
22    pub name: String,
23    /// Description of this mount.
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25    pub description: Option<String>,
26    /// Mounts that have this value, such as mining lasers, denote how powerful this mount's capabilities are.
27    #[serde(rename = "strength", skip_serializing_if = "Option::is_none")]
28    pub strength: Option<i32>,
29    /// Mounts that have this value denote what goods can be produced from using the mount.
30    #[serde(rename = "deposits", skip_serializing_if = "Option::is_none")]
31    pub deposits: Option<Vec<Deposits>>,
32    #[serde(rename = "requirements")]
33    pub requirements: Box<models::ShipRequirements>,
34}
35
36impl ShipMount {
37    /// A mount is installed on the exterier of a ship.
38    pub fn new(symbol: Symbol, name: String, requirements: models::ShipRequirements) -> ShipMount {
39        ShipMount {
40            symbol,
41            name,
42            description: None,
43            strength: None,
44            deposits: None,
45            requirements: Box::new(requirements),
46        }
47    }
48}
49/// Symbo of this mount.
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Symbol {
52    #[serde(rename = "MOUNT_GAS_SIPHON_I")]
53    MountGasSiphonI,
54    #[serde(rename = "MOUNT_GAS_SIPHON_II")]
55    MountGasSiphonIi,
56    #[serde(rename = "MOUNT_GAS_SIPHON_III")]
57    MountGasSiphonIii,
58    #[serde(rename = "MOUNT_SURVEYOR_I")]
59    MountSurveyorI,
60    #[serde(rename = "MOUNT_SURVEYOR_II")]
61    MountSurveyorIi,
62    #[serde(rename = "MOUNT_SURVEYOR_III")]
63    MountSurveyorIii,
64    #[serde(rename = "MOUNT_SENSOR_ARRAY_I")]
65    MountSensorArrayI,
66    #[serde(rename = "MOUNT_SENSOR_ARRAY_II")]
67    MountSensorArrayIi,
68    #[serde(rename = "MOUNT_SENSOR_ARRAY_III")]
69    MountSensorArrayIii,
70    #[serde(rename = "MOUNT_MINING_LASER_I")]
71    MountMiningLaserI,
72    #[serde(rename = "MOUNT_MINING_LASER_II")]
73    MountMiningLaserIi,
74    #[serde(rename = "MOUNT_MINING_LASER_III")]
75    MountMiningLaserIii,
76    #[serde(rename = "MOUNT_LASER_CANNON_I")]
77    MountLaserCannonI,
78    #[serde(rename = "MOUNT_MISSILE_LAUNCHER_I")]
79    MountMissileLauncherI,
80    #[serde(rename = "MOUNT_TURRET_I")]
81    MountTurretI,
82}
83
84impl Default for Symbol {
85    fn default() -> Symbol {
86        Self::MountGasSiphonI
87    }
88}
89/// Mounts that have this value denote what goods can be produced from using the mount.
90#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
91pub enum Deposits {
92    #[serde(rename = "QUARTZ_SAND")]
93    QuartzSand,
94    #[serde(rename = "SILICON_CRYSTALS")]
95    SiliconCrystals,
96    #[serde(rename = "PRECIOUS_STONES")]
97    PreciousStones,
98    #[serde(rename = "ICE_WATER")]
99    IceWater,
100    #[serde(rename = "AMMONIA_ICE")]
101    AmmoniaIce,
102    #[serde(rename = "IRON_ORE")]
103    IronOre,
104    #[serde(rename = "COPPER_ORE")]
105    CopperOre,
106    #[serde(rename = "SILVER_ORE")]
107    SilverOre,
108    #[serde(rename = "ALUMINUM_ORE")]
109    AluminumOre,
110    #[serde(rename = "GOLD_ORE")]
111    GoldOre,
112    #[serde(rename = "PLATINUM_ORE")]
113    PlatinumOre,
114    #[serde(rename = "DIAMONDS")]
115    Diamonds,
116    #[serde(rename = "URANITE_ORE")]
117    UraniteOre,
118    #[serde(rename = "MERITIUM_ORE")]
119    MeritiumOre,
120}
121
122impl Default for Deposits {
123    fn default() -> Deposits {
124        Self::QuartzSand
125    }
126}
127