#[derive(Debug, Copy, Clone, PartialEq)] pub enum ArmorType { Frame, Armor, } impl ArmorType { pub fn value(&self) -> [u8; 3] { match self { ArmorType::Frame => [0x01, 0x01, 0x00], ArmorType::Armor => [0x01, 0x01, 0x00], } } } // TODO: TryFrom<&str> // TODO Into #[derive(Debug, Copy, Clone, PartialEq)] pub struct Armor { pub armor: ArmorType, pub dfp: u8, pub evp: u8, pub slots: u8, } impl Armor { pub fn as_bytes(&self) -> [u8; 16] { let mut result = [0; 16]; result[0..3].copy_from_slice(&self.armor.value()); // TODO: other attrs result } }