use std::collections::HashMap;

use proto::{InteractInfo, InteractTarget};

use crate::logic::math::InteractScale;

#[derive(Debug)]
pub struct InteractComponent {
    pub interact_id: u32,
    pub participators: HashMap<u32, String>,
    pub scale: InteractScale,
}

impl InteractComponent {
    pub fn to_client(&self) -> InteractInfo {
        InteractInfo {
            interact_id: self.interact_id as i32,
            participators: self.participators.clone(),
            interact_target_list: vec![InteractTarget::Npc.into()], // TODO
            scale_x: self.scale.x,
            scale_y: self.scale.y,
            scale_z: self.scale.z,
            scale_w: self.scale.w,
            scale_r: self.scale.r,
            ..Default::default()
        }
    }
}
