wolfrpg_map_parser/command/input_key_command/automatic_input/
basic.rs1#[cfg(feature = "serde")]
2use serde::{Serialize, Deserialize};
3use crate::command::input_key_command::automatic_input::basic_options::BasicOptions;
4
5#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6#[derive(PartialEq, Clone)]
7pub struct Basic {
8 options: BasicOptions
9}
10
11impl Basic {
12 pub(crate) fn parse(bytes: &[u8]) -> (usize, Self) {
13 let mut offset: usize = 0;
14
15 let options: u8 = bytes[offset];
16 let options: BasicOptions = BasicOptions::new(options);
17 offset += 1;
18
19 offset += 2; offset += 1; (offset, Self {
24 options
25 })
26 }
27
28 pub fn options(&self) -> &BasicOptions {
29 &self.options
30 }
31
32 pub fn options_mut(&mut self) -> &mut BasicOptions {
33 &mut self.options
34 }
35}