#[repr(u8)]pub enum Dir {
Up = 0,
RightUp = 1,
RightDown = 2,
Down = 3,
LeftDown = 4,
LeftUp = 5,
}Expand description
One of the six lattice directions of the flat-top hex grid, ordered clockwise starting at the top.
In axial coordinates the deltas are:
| direction | delta | pixel delta (size = circumradius) |
|---|---|---|
Dir::Up | (0, -1) | (0, -√3·size) |
Dir::RightUp | (1, -1) | (1.5·size, -√3/2·size) |
Dir::RightDown | (1, 0) | (1.5·size, +√3/2·size) |
Dir::Down | (0, +1) | (0, +√3·size) |
Dir::LeftDown | (-1, +1) | (-1.5·size, +√3/2·size) |
Dir::LeftUp | (-1, 0) | (-1.5·size, -√3/2·size) |
Variants§
Implementations§
Trait Implementations§
impl Copy for Dir
impl Eq for Dir
impl StructuralPartialEq for Dir
Auto Trait Implementations§
impl Freeze for Dir
impl RefUnwindSafe for Dir
impl Send for Dir
impl Sync for Dir
impl Unpin for Dir
impl UnsafeUnpin for Dir
impl UnwindSafe for Dir
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more