forked from NewEriduPubSec/JaneDoe-ZS
Implement Combat commissions (PureHollowBattle and LongFight) (including Rally commissions) Refactor some battle structures Unlock hollow quests (QuestInfo and YorozuyaInfo)
25 lines
648 B
Rust
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(),
|
|
}
|
|
}
|
|
}
|