[][src]Struct bestagon::coords::Axial

pub struct Axial(pub i8, pub i8);

Trait Implementations

impl Clone for Axial[src]

impl Copy for Axial[src]

impl Debug for Axial[src]

impl Distance for Axial[src]

fn dist(&self, other: &Axial) -> u8[src]

use bestagon::{coords::Axial, distance::Distance};
assert_eq!(Axial(0, 4).dist(&Axial(1, 2)), 2);
assert_eq!(Axial(-3, 2).dist(&Axial(3, -1)), 6);

impl Eq for Axial[src]

impl Into<Axial> for Cube[src]

impl Into<Cube> for Axial[src]

impl LinearInterpolation for Axial[src]

fn lerp(&self, to: &Axial, t: f32) -> Axial[src]

use bestagon::{coords::Axial, lerp::LinearInterpolation};
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.00), Axial(0, 0));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.25), Axial(1, -1));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.49), Axial(2, -2));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.51), Axial(3, -2));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.75), Axial(4, -3));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 1.00), Axial(5, -4));

impl Neighbour for Axial[src]

impl PartialEq<Axial> for Axial[src]

impl StructuralEq for Axial[src]

impl StructuralPartialEq for Axial[src]

Auto Trait Implementations

impl RefUnwindSafe for Axial

impl Send for Axial

impl Sync for Axial

impl Unpin for Axial

impl UnwindSafe for Axial

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> GridLine for T where
    T: LinearInterpolation + Distance
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<C> Neighbours for C where
    C: Neighbour
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.