Reid 2023-09-15 22:27:07 -07:00
parent 64b65ba3ce
commit fd88a4e374
Signed by: reidlab
GPG key ID: 6C9EAA3364F962C8
4 changed files with 28 additions and 5 deletions

View file

@ -21,6 +21,14 @@ macro_rules! object_prop_bool {
};
}
macro_rules! object_prop_int {
($key:expr, $name:ident) => {
pub fn $name(&self) -> Option<i32> {
self.raw.get($key).and_then(|s| s.parse().ok())
}
};
}
#[derive(Clone)]
pub struct ObjectData {
raw: HashMap<String, String>
@ -44,6 +52,7 @@ impl ObjectData {
}
object_prop_bool!("13", checked);
object_prop_int!("80", item_block_id);
}
pub enum PortalSpeed {