space_traders_api/models/
ship_role.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/// ShipRole : The registered role of the ship
15/// The registered role of the ship
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum ShipRole {
18    #[serde(rename = "FABRICATOR")]
19    Fabricator,
20    #[serde(rename = "HARVESTER")]
21    Harvester,
22    #[serde(rename = "HAULER")]
23    Hauler,
24    #[serde(rename = "INTERCEPTOR")]
25    Interceptor,
26    #[serde(rename = "EXCAVATOR")]
27    Excavator,
28    #[serde(rename = "TRANSPORT")]
29    Transport,
30    #[serde(rename = "REPAIR")]
31    Repair,
32    #[serde(rename = "SURVEYOR")]
33    Surveyor,
34    #[serde(rename = "COMMAND")]
35    Command,
36    #[serde(rename = "CARRIER")]
37    Carrier,
38    #[serde(rename = "PATROL")]
39    Patrol,
40    #[serde(rename = "SATELLITE")]
41    Satellite,
42    #[serde(rename = "EXPLORER")]
43    Explorer,
44    #[serde(rename = "REFINERY")]
45    Refinery,
46
47}
48
49impl std::fmt::Display for ShipRole {
50    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
51        match self {
52            Self::Fabricator => write!(f, "FABRICATOR"),
53            Self::Harvester => write!(f, "HARVESTER"),
54            Self::Hauler => write!(f, "HAULER"),
55            Self::Interceptor => write!(f, "INTERCEPTOR"),
56            Self::Excavator => write!(f, "EXCAVATOR"),
57            Self::Transport => write!(f, "TRANSPORT"),
58            Self::Repair => write!(f, "REPAIR"),
59            Self::Surveyor => write!(f, "SURVEYOR"),
60            Self::Command => write!(f, "COMMAND"),
61            Self::Carrier => write!(f, "CARRIER"),
62            Self::Patrol => write!(f, "PATROL"),
63            Self::Satellite => write!(f, "SATELLITE"),
64            Self::Explorer => write!(f, "EXPLORER"),
65            Self::Refinery => write!(f, "REFINERY"),
66        }
67    }
68}
69
70impl Default for ShipRole {
71    fn default() -> ShipRole {
72        Self::Fabricator
73    }
74}
75