use serde::Deserialize; #[derive(Debug, Clone, Deserialize)] pub struct Level { id: String, sort_order: i32, name: String, description: String, #[serde(default)] is_sandbox: bool, init_board: Option, inputs: Vec, outputs: Vec, } impl Level { pub fn id(&self) -> &str { &self.id } pub fn sort_order(&self) -> i32 { self.sort_order } pub fn name(&self) -> &str { &self.name } pub fn description(&self) -> &str { &self.description } pub fn is_sandbox(&self) -> bool { self.is_sandbox } pub fn init_board(&self) -> Option { self.init_board.clone() } pub fn inputs(&self) -> &[u8] { &self.inputs } pub fn outputs(&self) -> &[u8] { &self.outputs } }