wicked-waifus-rs/game-server/src/logic/components/weapon.rs
xavo95 96d1994fe2 Support for Nested combat messages and JSPatch Notify from files (#2)
Reviewed-on: Shorekeeper/Shorekeeper#2
Co-authored-by: xavo95 <xavo95@xeondev.com>
Co-committed-by: xavo95 <xavo95@xeondev.com>
2024-09-14 09:05:17 +00:00

19 lines
618 B
Rust

use shorekeeper_protocol::{EntityComponentPb, EquipComponentPb};
use shorekeeper_protocol::entity_component_pb::ComponentPb;
use crate::logic::ecs::component::Component;
pub struct Weapon {
pub weapon_id: i32,
pub weapon_breach_level: i32,
}
impl Component for Weapon {
fn set_pb_data(&self, pb: &mut shorekeeper_protocol::EntityPb) {
pb.component_pbs.push(EntityComponentPb {
component_pb: Some(ComponentPb::EquipComponent(EquipComponentPb {
weapon_id: self.weapon_id,
weapon_breach_level: self.weapon_breach_level,
}))
})
}
}