space_traders/models/
ship_crew.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// The ship's crew service and maintain the ship's systems and equipment.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ShipCrew {
10    /// The current number of crew members on the ship.
11    #[serde(rename = "current")]
12    pub current: i32,
13    /// The minimum number of crew members required to maintain the ship.
14    #[serde(rename = "required")]
15    pub required: i32,
16    /// The maximum number of crew members the ship can support.
17    #[serde(rename = "capacity")]
18    pub capacity: i32,
19    /// The rotation of crew shifts. A stricter shift improves the ship's performance. A more relaxed shift improves the crew's morale.
20    #[serde(rename = "rotation")]
21    pub rotation: Rotation,
22    /// 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.
23    #[serde(rename = "morale")]
24    pub morale: u32,
25    /// The amount of credits per crew member paid per hour. Wages are paid when a ship docks at a civilized waypoint.
26    #[serde(rename = "wages")]
27    pub wages: u32,
28}
29
30impl ShipCrew {
31    /// Create value with optional fields set to `None`.
32    #[allow(clippy::too_many_arguments)]
33    pub fn new(
34        current: i32,
35        required: i32,
36        capacity: i32,
37        rotation: Rotation,
38        morale: u32,
39        wages: u32,
40    ) -> ShipCrew {
41        ShipCrew {
42            current,
43            required,
44            capacity,
45            rotation,
46            morale,
47            wages,
48        }
49    }
50}
51
52/// The rotation of crew shifts. A stricter shift improves the ship's performance. A more relaxed shift improves the crew's morale.
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum Rotation {
55    #[serde(rename = "STRICT")]
56    Strict,
57    #[serde(rename = "RELAXED")]
58    Relaxed,
59}
60
61impl Default for Rotation {
62    fn default() -> Rotation {
63        Self::Strict
64    }
65}