This commit is contained in:
parent
64b65ba3ce
commit
fd88a4e374
4 changed files with 28 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue