Skip to main content

space_traders/models/
scanned_system.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// Details of a system was that scanned.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ScannedSystem {
10    /// Symbol of the system.
11    #[serde(rename = "symbol")]
12    pub symbol: String,
13    /// Symbol of the system's sector.
14    #[serde(rename = "sectorSymbol")]
15    pub sector_symbol: String,
16    #[serde(rename = "type")]
17    pub r#type: crate::models::SystemType,
18    /// Position in the universe in the x axis.
19    #[serde(rename = "x")]
20    pub x: i32,
21    /// Position in the universe in the y axis.
22    #[serde(rename = "y")]
23    pub y: i32,
24    /// The system's distance from the scanning ship.
25    #[serde(rename = "distance")]
26    pub distance: i32,
27}
28
29impl ScannedSystem {
30    /// Create value with optional fields set to `None`.
31    #[allow(clippy::too_many_arguments)]
32    pub fn new(
33        symbol: String,
34        sector_symbol: String,
35        r#type: crate::models::SystemType,
36        x: i32,
37        y: i32,
38        distance: i32,
39    ) -> ScannedSystem {
40        ScannedSystem {
41            symbol,
42            sector_symbol,
43            r#type,
44            x,
45            y,
46            distance,
47        }
48    }
49}