pub type Time=i64;

#[binrw::binrw]
#[brw(little)]
pub struct Ratio64{
	num:i64,
	den:u64,
}
#[derive(Debug)]
pub enum RatioError{
	ZeroDenominator,
}
impl std::fmt::Display for RatioError{
	fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{
		write!(f,"{self:?}")
	}
}
impl std::error::Error for RatioError{}
impl TryInto<strafesnet_common::integer::Ratio64> for Ratio64{
	type Error=RatioError;
	fn try_into(self)->Result<strafesnet_common::integer::Ratio64,Self::Error>{
		strafesnet_common::integer::Ratio64::new(self.num,self.den)
		.ok_or(RatioError::ZeroDenominator)
	}
}
impl From<strafesnet_common::integer::Ratio64> for Ratio64{
	fn from(value:strafesnet_common::integer::Ratio64)->Self{
		Self{
			num:value.num(),
			den:value.den(),
		}
	}
}

#[binrw::binrw]
#[brw(little)]
pub struct Ratio64Vec2{
	pub x:Ratio64,
	pub y:Ratio64,
}

pub type Angle32=i32;
pub type Planar64=i64;
pub type Planar64Vec3=[i64;3];
pub type Planar64Mat3=[i64;9];
pub type Planar64Affine3=[i64;12];
