marble-machinations/src/level.rs

37 lines
547 B
Rust

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