break down engine modules

This commit is contained in:
🪞👃🪞 2025-01-05 08:16:15 +01:00
parent f6c603bf73
commit 905486edbd
16 changed files with 376 additions and 352 deletions

View file

@ -0,0 +1,26 @@
use std::fmt::{Debug, Display};
use std::ops::{Add, Sub, Mul, Div};
/// A linear coordinate.
pub trait Coordinate: Send + Sync + Copy
+ Add<Self, Output=Self>
+ Sub<Self, Output=Self>
+ Mul<Self, Output=Self>
+ Div<Self, Output=Self>
+ Ord + PartialEq + Eq
+ Debug + Display + Default
+ From<u16> + Into<u16>
+ Into<usize>
+ Into<f64>
{
#[inline] fn minus (self, other: Self) -> Self {
if self >= other {
self - other
} else {
0.into()
}
}
#[inline] fn zero () -> Self {
0.into()
}
}