[][src]Struct bestagon::coords::Cube

pub struct Cube(pub i8, pub i8, pub i8);

Trait Implementations

impl Clone for Cube[src]

impl Copy for Cube[src]

impl Debug for Cube[src]

impl Distance for Cube[src]

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

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

impl Eq for Cube[src]

impl Hash for Cube[src]

impl Into<Axial> for Cube[src]

impl Into<Cube> for Axial[src]

impl LinearInterpolation for Cube[src]

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

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

impl Neighbour for Cube[src]

impl PartialEq<Cube> for Cube[src]

impl Range for Cube[src]

impl StructuralEq for Cube[src]

impl StructuralPartialEq for Cube[src]

Auto Trait Implementations

impl RefUnwindSafe for Cube

impl Send for Cube

impl Sync for Cube

impl Unpin for Cube

impl UnwindSafe for Cube

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.