pub mod linear;
pub mod storage;
pub const trait GetY<T> {
#[must_use]
fn get_y(&self, x: T) -> T;
}
#[cfg(feature = "std")]
pub const trait GetCollisions<E, T> {
#[must_use]
fn get_collisions(&self, other: &E) -> Option<Vec<T>>;
}
#[cfg(feature = "std")]
impl<E, T, S: GetCollisions<E, T>> GetCollisions<S, T> for E {
fn get_collisions(&self, other: &S) -> Option<Vec<T>> {
other.get_collisions(self)
}
}
pub const trait FlipExpression {
#[must_use]
fn flip_vertically(&self) -> Self;
#[must_use]
fn flip_horizontally(&self) -> Self;
}
pub const trait SetFlippedExpression: FlipExpression {
fn set_flipped_vertically(&mut self);
fn set_flipped_horizontally(&mut self);
}
impl<T: FlipExpression> SetFlippedExpression for T {
fn set_flipped_horizontally(&mut self) {
*self = self.flip_horizontally();
}
fn set_flipped_vertically(&mut self) {
*self = self.flip_vertically();
}
}