JaneDoe-ZS/nap_gameserver/src/logic/battle/unit/buddy.rs
xeon 50f694add0 H.D.D. and Combat commissions implementation
Implement Combat commissions (PureHollowBattle and LongFight) (including Rally commissions)
Refactor some battle structures
Unlock hollow quests (QuestInfo and YorozuyaInfo)
2024-08-05 17:45:13 +03:00

25 lines
648 B
Rust

use std::collections::HashMap;
use proto::BuddyUnitInfo;
use crate::logic::{BaseProperty, BuddyTeamType};
pub struct BuddyUnit {
pub buddy_id: u32,
pub buddy_team: BuddyTeamType,
pub override_property_map: HashMap<BaseProperty, i32>,
}
impl BuddyUnit {
pub fn to_client(&self) -> BuddyUnitInfo {
BuddyUnitInfo {
buddy_id: self.buddy_id,
r#type: self.buddy_team.to_protocol().into(),
mp_property_override_map: self
.override_property_map
.iter()
.map(|(prop, value)| (*prop as u32, *value))
.collect(),
}
}
}