use super::integer::Time;

#[binrw::binrw]
#[brw(little)]
pub struct MouseState{
	pub pos:[i32;2],
	pub time:Time,
}

impl<T> Into<strafesnet_common::mouse::MouseState<T>> for MouseState{
	fn into(self)->strafesnet_common::mouse::MouseState<T>{
		strafesnet_common::mouse::MouseState{
			pos:self.pos.into(),
			time:strafesnet_common::integer::Time::raw(self.time),
		}
	}
}
impl<T> From<strafesnet_common::mouse::MouseState<T>> for MouseState{
	fn from(value:strafesnet_common::mouse::MouseState<T>)->Self{
		Self{
			pos:value.pos.to_array(),
			time:value.time.get(),
		}
	}
}
