#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Expedition { pub id: u64, pub ship_count: u64, pub origin: String, pub destination: String, pub owner: usize, pub turns_remaining: u64, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Planet { pub ship_count: u64, pub x: f64, pub y: f64, pub owner: Option, pub name: String, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Action { #[serde(rename = "moves")] pub commands: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Command { pub origin: String, pub destination: String, pub ship_count: u64, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct State { pub planets: Vec, pub expeditions: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GameInfo { pub players: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum CommandError { NotEnoughShips, OriginNotOwned, ZeroShipMove, OriginDoesNotExist, DestinationDoesNotExist, }