Struct hex_coordinates::AxialCoordinates
source · [−]Expand description
CubeCoordinates minus s coordinate.
Fields
q: isizer: isizeImplementations
sourceimpl AxialCoordinates
impl AxialCoordinates
sourcepub const fn neighbor(&self, direction: Direction) -> Self
pub const fn neighbor(&self, direction: Direction) -> Self
Returns the neighboring coordinates in a given direction.
sourcepub const fn manhattan_distance(&self, other: Self) -> usize
pub const fn manhattan_distance(&self, other: Self) -> usize
Returns the manhattan distance between 2 coordinates.
sourcepub fn coordinate_range(&self, range: usize) -> Vec<Self>
pub fn coordinate_range(&self, range: usize) -> Vec<Self>
Returns all coordinates steps steps from self where { -range <= steps <= range }.
Panics
When isize::try_from(range).is_err().
Trait Implementations
sourceimpl Add<AxialCoordinates> for AxialCoordinates
impl Add<AxialCoordinates> for AxialCoordinates
type Output = AxialCoordinates
type Output = AxialCoordinates
The resulting type after applying the + operator.
sourceimpl AddAssign<AxialCoordinates> for AxialCoordinates
impl AddAssign<AxialCoordinates> for AxialCoordinates
sourceconst fn add_assign(&mut self, other: Self)
const fn add_assign(&mut self, other: Self)
Performs the += operation. Read more
sourceimpl Clone for AxialCoordinates
impl Clone for AxialCoordinates
sourcefn clone(&self) -> AxialCoordinates
fn clone(&self) -> AxialCoordinates
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for AxialCoordinates
impl Debug for AxialCoordinates
sourceimpl Div<isize> for AxialCoordinates
impl Div<isize> for AxialCoordinates
sourceimpl DivAssign<isize> for AxialCoordinates
impl DivAssign<isize> for AxialCoordinates
sourceconst fn div_assign(&mut self, rhs: isize)
const fn div_assign(&mut self, rhs: isize)
Performs the /= operation. Read more
sourceimpl From<AxialCoordinates> for CubeCoordinates
impl From<AxialCoordinates> for CubeCoordinates
sourceconst fn from(_: AxialCoordinates) -> Self
const fn from(_: AxialCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<AxialCoordinates> for DoubledCoordinates<{ DoubledSystem::Height }>
impl From<AxialCoordinates> for DoubledCoordinates<{ DoubledSystem::Height }>
sourceconst fn from(_: AxialCoordinates) -> Self
const fn from(_: AxialCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<AxialCoordinates> for DoubledCoordinates<{ DoubledSystem::Width }>
impl From<AxialCoordinates> for DoubledCoordinates<{ DoubledSystem::Width }>
sourceconst fn from(_: AxialCoordinates) -> Self
const fn from(_: AxialCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::EvenQ }>
impl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::EvenQ }>
sourceconst fn from(_: AxialCoordinates) -> Self
const fn from(_: AxialCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::EvenR }>
impl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::EvenR }>
sourceconst fn from(_: AxialCoordinates) -> Self
const fn from(_: AxialCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::OddQ }>
impl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::OddQ }>
sourceconst fn from(_: AxialCoordinates) -> Self
const fn from(_: AxialCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::OddR }>
impl From<AxialCoordinates> for OffsetCoordinates<{ OffsetSystem::OddR }>
sourceconst fn from(_: AxialCoordinates) -> Self
const fn from(_: AxialCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<CubeCoordinates> for AxialCoordinates
impl From<CubeCoordinates> for AxialCoordinates
sourceconst fn from(_: CubeCoordinates) -> Self
const fn from(_: CubeCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<Direction> for AxialCoordinates
impl From<Direction> for AxialCoordinates
sourceimpl From<DoubledCoordinates<{ DoubledSystem::Height }>> for AxialCoordinates
impl From<DoubledCoordinates<{ DoubledSystem::Height }>> for AxialCoordinates
sourceconst fn from(_: DoubledCoordinates<{ DoubledSystem::Height }>) -> Self
const fn from(_: DoubledCoordinates<{ DoubledSystem::Height }>) -> Self
Converts to this type from the input type.
sourceimpl From<DoubledCoordinates<{ DoubledSystem::Width }>> for AxialCoordinates
impl From<DoubledCoordinates<{ DoubledSystem::Width }>> for AxialCoordinates
sourceconst fn from(_: DoubledCoordinates<{ DoubledSystem::Width }>) -> Self
const fn from(_: DoubledCoordinates<{ DoubledSystem::Width }>) -> Self
Converts to this type from the input type.
sourceimpl From<OffsetCoordinates<{ OffsetSystem::EvenQ }>> for AxialCoordinates
impl From<OffsetCoordinates<{ OffsetSystem::EvenQ }>> for AxialCoordinates
sourceconst fn from(_: OffsetCoordinates<{ OffsetSystem::EvenQ }>) -> Self
const fn from(_: OffsetCoordinates<{ OffsetSystem::EvenQ }>) -> Self
Converts to this type from the input type.
sourceimpl From<OffsetCoordinates<{ OffsetSystem::EvenR }>> for AxialCoordinates
impl From<OffsetCoordinates<{ OffsetSystem::EvenR }>> for AxialCoordinates
sourceconst fn from(_: OffsetCoordinates<{ OffsetSystem::EvenR }>) -> Self
const fn from(_: OffsetCoordinates<{ OffsetSystem::EvenR }>) -> Self
Converts to this type from the input type.
sourceimpl From<OffsetCoordinates<{ OffsetSystem::OddQ }>> for AxialCoordinates
impl From<OffsetCoordinates<{ OffsetSystem::OddQ }>> for AxialCoordinates
sourceconst fn from(_: OffsetCoordinates<{ OffsetSystem::OddQ }>) -> Self
const fn from(_: OffsetCoordinates<{ OffsetSystem::OddQ }>) -> Self
Converts to this type from the input type.
sourceimpl From<OffsetCoordinates<{ OffsetSystem::OddR }>> for AxialCoordinates
impl From<OffsetCoordinates<{ OffsetSystem::OddR }>> for AxialCoordinates
sourceconst fn from(_: OffsetCoordinates<{ OffsetSystem::OddR }>) -> Self
const fn from(_: OffsetCoordinates<{ OffsetSystem::OddR }>) -> Self
Converts to this type from the input type.
sourceimpl Mul<isize> for AxialCoordinates
impl Mul<isize> for AxialCoordinates
sourceimpl MulAssign<isize> for AxialCoordinates
impl MulAssign<isize> for AxialCoordinates
sourceconst fn mul_assign(&mut self, rhs: isize)
const fn mul_assign(&mut self, rhs: isize)
Performs the *= operation. Read more
sourceimpl PartialEq<AxialCoordinates> for AxialCoordinates
impl PartialEq<AxialCoordinates> for AxialCoordinates
sourcefn eq(&self, other: &AxialCoordinates) -> bool
fn eq(&self, other: &AxialCoordinates) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &AxialCoordinates) -> bool
fn ne(&self, other: &AxialCoordinates) -> bool
This method tests for !=.
sourceimpl Sub<AxialCoordinates> for AxialCoordinates
impl Sub<AxialCoordinates> for AxialCoordinates
type Output = AxialCoordinates
type Output = AxialCoordinates
The resulting type after applying the - operator.
sourceimpl SubAssign<AxialCoordinates> for AxialCoordinates
impl SubAssign<AxialCoordinates> for AxialCoordinates
sourceconst fn sub_assign(&mut self, other: Self)
const fn sub_assign(&mut self, other: Self)
Performs the -= operation. Read more
impl Copy for AxialCoordinates
impl Eq for AxialCoordinates
impl StructuralEq for AxialCoordinates
impl StructuralPartialEq for AxialCoordinates
Auto Trait Implementations
impl RefUnwindSafe for AxialCoordinates
impl Send for AxialCoordinates
impl Sync for AxialCoordinates
impl Unpin for AxialCoordinates
impl UnwindSafe for AxialCoordinates
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more