2024-10-06 12:39:36 +02:00
|
|
|
use serde::Deserialize;
|
|
|
|
|
2024-10-06 16:00:12 +02:00
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
2024-10-06 12:39:36 +02:00
|
|
|
pub struct Level {
|
|
|
|
id: String,
|
2024-10-07 12:04:55 +02:00
|
|
|
sort_order: i32,
|
2024-10-06 12:39:36 +02:00
|
|
|
name: String,
|
|
|
|
description: String,
|
|
|
|
init_board: Option<String>,
|
|
|
|
inputs: Vec<u8>,
|
|
|
|
outputs: Vec<u8>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Level {
|
|
|
|
pub fn id(&self) -> &str {
|
|
|
|
&self.id
|
|
|
|
}
|
|
|
|
|
2024-10-07 12:04:55 +02:00
|
|
|
pub fn sort_order(&self) -> i32 {
|
|
|
|
self.sort_order
|
|
|
|
}
|
|
|
|
|
2024-10-06 12:39:36 +02:00
|
|
|
pub fn name(&self) -> &str {
|
|
|
|
&self.name
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn description(&self) -> &str {
|
|
|
|
&self.description
|
|
|
|
}
|
|
|
|
|
2024-10-06 22:24:37 +02:00
|
|
|
pub fn init_board(&self) -> Option<String> {
|
2024-10-06 16:00:12 +02:00
|
|
|
self.init_board.clone()
|
2024-10-06 12:39:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn inputs(&self) -> &[u8] {
|
|
|
|
&self.inputs
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn outputs(&self) -> &[u8] {
|
|
|
|
&self.outputs
|
|
|
|
}
|
|
|
|
}
|