You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
678 B

#[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<String>
#[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
}
}