wolfrpg_map_parser/command/input_key_command/input_key/
key_options.rs1#[cfg(feature = "serde")]
2use serde::{Serialize, Deserialize};
3
4#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5#[derive(PartialEq, Clone)]
6pub struct KeyOptions {
7 wait_for_input: bool
8}
9
10impl KeyOptions {
11 pub fn new(options: u8) -> Self {
12 Self {
13 wait_for_input: options & 0b10000000 != 0
14 }
15 }
16
17 pub fn wait_for_input(&self) -> bool {
18 self.wait_for_input
19 }
20
21 pub fn wait_for_input_mut(&mut self) -> &mut bool {
22 &mut self.wait_for_input
23 }
24}