wolfrpg_map_parser/command/set_string_command/
input.rs1use crate::byte_utils::as_u32_le;
2#[cfg(feature = "serde")]
3use serde::{Serialize, Deserialize};
4
5#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6#[derive(PartialEq, Clone)]
7pub struct Input {
8 max_length: u32
9}
10
11impl Input {
12 pub(crate) fn parse(bytes: &[u8]) -> (usize, Self) {
13 let mut offset: usize = 0;
14
15 let max_length: u32 = as_u32_le(&bytes[offset..offset + 4]);
16 offset += 4;
17
18 offset += 3; (offset, Self {
21 max_length
22 })
23 }
24
25 pub fn max_length(&self) -> u32 {
26 self.max_length
27 }
28
29 pub fn max_length_mut(&mut self) -> &mut u32 {
30 &mut self.max_length
31 }
32}