#![feature(associated_type_defaults)]
use endgame_direction::{Direction, DirectionSet};
pub trait GridCoord: Sized + PartialEq + Eq + Clone + std::fmt::Debug + std::fmt::Display {
fn angle_to_direction(&self, angle: f32) -> Direction;
fn direction_angle(&self, dir: Direction) -> Option<f32>;
fn move_in_direction(&self, dir: Direction) -> Option<Self>;
fn allowed_direction(&self, dir: Direction) -> bool;
fn allowed_directions(&self) -> DirectionSet;
fn grid_to_array_offset(&self) -> (isize, isize);
fn array_offset_to_grid(array_offset: (isize, isize)) -> Self;
}
type Point = glam::Vec2;
pub trait SizedGrid {
type Coord: GridCoord;
fn inradius(&self) -> f32;
fn circumradius(&self) -> f32;
fn edge_length(&self) -> f32;
fn grid_to_screen(&self, coord: Self::Coord) -> Point;
fn screen_to_grid(&self, point: Point) -> Self::Coord;
}
pub mod hex;
pub mod square;
pub mod triangle;