diff --git a/src/entity/item/mod.rs b/src/entity/item/mod.rs index 1ecf08a..5e56f7b 100644 --- a/src/entity/item/mod.rs +++ b/src/entity/item/mod.rs @@ -2,6 +2,7 @@ pub mod weapon; pub mod armor; pub mod shield; pub mod tool; +pub mod unit; //use libpso::item; use libpso::character::character; @@ -57,6 +58,12 @@ pub struct Shield { pub shield: shield::Shield, } +#[derive(Clone, Debug, PartialEq)] +pub struct Unit { + pub equipped: bool, + pub unit: unit::Unit, +} + #[derive(Clone, Debug, PartialEq)] pub struct Tool { pub tool: tool::ToolType, @@ -75,6 +82,7 @@ pub enum ItemDetail { Weapon(Weapon), Armor(Armor), Shield(Shield), + Unit(Unit), Tool(Tool), } @@ -91,6 +99,7 @@ impl ItemDetail { ItemDetail::Weapon(weapon) => weapon.weapon.as_bytes(), ItemDetail::Armor(armor) => armor.armor.as_bytes(), ItemDetail::Shield(shield) => shield.shield.as_bytes(), + ItemDetail::Unit(unit) => unit.unit.as_bytes(), ItemDetail::Tool(tool) => tool.as_bytes(), } } diff --git a/src/ship/items.rs b/src/ship/items.rs index 4ae88df..0959d1a 100644 --- a/src/ship/items.rs +++ b/src/ship/items.rs @@ -108,6 +108,7 @@ impl Hash for StackedItemKey { ItemDetail::Weapon(w) => w.weapon.weapon.value().hash(hasher), ItemDetail::Armor(a) => a.armor.armor.value().hash(hasher), ItemDetail::Shield(s) => s.shield.shield.value().hash(hasher), + ItemDetail::Unit(u) => u.unit.unit.value().hash(hasher), ItemDetail::Tool(t) => t.tool.value().hash(hasher), } }