space_traders/models/
connected_system.rs1use serde::{Deserialize, Serialize};
6
7#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ConnectedSystem {
10 #[serde(rename = "symbol")]
12 pub symbol: String,
13 #[serde(rename = "sectorSymbol")]
15 pub sector_symbol: String,
16 #[serde(rename = "type")]
17 pub r#type: crate::models::SystemType,
18 #[serde(rename = "factionSymbol", skip_serializing_if = "Option::is_none")]
20 pub faction_symbol: Option<String>,
21 #[serde(rename = "x")]
23 pub x: i32,
24 #[serde(rename = "y")]
26 pub y: i32,
27 #[serde(rename = "distance")]
29 pub distance: i32,
30}
31
32impl ConnectedSystem {
33 #[allow(clippy::too_many_arguments)]
35 pub fn new(
36 symbol: String,
37 sector_symbol: String,
38 r#type: crate::models::SystemType,
39 x: i32,
40 y: i32,
41 distance: i32,
42 ) -> ConnectedSystem {
43 ConnectedSystem {
44 symbol,
45 sector_symbol,
46 r#type,
47 faction_symbol: None,
48 x,
49 y,
50 distance,
51 }
52 }
53}