space_traders_api/models/
ship_crew.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/// ShipCrew : The ship's crew service and maintain the ship's systems and equipment.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ShipCrew {
17    /// The current number of crew members on the ship.
18    #[serde(rename = "current")]
19    pub current: i32,
20    /// The minimum number of crew members required to maintain the ship.
21    #[serde(rename = "required")]
22    pub required: i32,
23    /// The maximum number of crew members the ship can support.
24    #[serde(rename = "capacity")]
25    pub capacity: i32,
26    /// The rotation of crew shifts. A stricter shift improves the ship's performance. A more relaxed shift improves the crew's morale.
27    #[serde(rename = "rotation")]
28    pub rotation: Rotation,
29    /// A rough measure of the crew's morale. A higher morale means the crew is happier and more productive. A lower morale means the ship is more prone to accidents.
30    #[serde(rename = "morale")]
31    pub morale: i32,
32    /// The amount of credits per crew member paid per hour. Wages are paid when a ship docks at a civilized waypoint.
33    #[serde(rename = "wages")]
34    pub wages: i32,
35}
36
37impl ShipCrew {
38    /// The ship's crew service and maintain the ship's systems and equipment.
39    pub fn new(current: i32, required: i32, capacity: i32, rotation: Rotation, morale: i32, wages: i32) -> ShipCrew {
40        ShipCrew {
41            current,
42            required,
43            capacity,
44            rotation,
45            morale,
46            wages,
47        }
48    }
49}
50/// The rotation of crew shifts. A stricter shift improves the ship's performance. A more relaxed shift improves the crew's morale.
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum Rotation {
53    #[serde(rename = "STRICT")]
54    Strict,
55    #[serde(rename = "RELAXED")]
56    Relaxed,
57}
58
59impl Default for Rotation {
60    fn default() -> Rotation {
61        Self::Strict
62    }
63}
64