Struct hex_coordinates::DoubledCoordinates
source · [−]pub struct DoubledCoordinates<const S: DoubledSystem> {
pub col: Immutable<isize>,
pub row: Immutable<isize>,
}Expand description
See DoubledSystem.
Fields
col: Immutable<isize>row: Immutable<isize>Implementations
sourceimpl<const S: DoubledSystem> DoubledCoordinates<S>
impl<const S: DoubledSystem> DoubledCoordinates<S>
sourceimpl DoubledCoordinates<{ DoubledSystem::Height }>
impl DoubledCoordinates<{ DoubledSystem::Height }>
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().
sourceimpl DoubledCoordinates<{ DoubledSystem::Width }>
impl DoubledCoordinates<{ DoubledSystem::Width }>
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<const S: DoubledSystem> Add<DoubledCoordinates<S>> for DoubledCoordinates<S>
impl<const S: DoubledSystem> Add<DoubledCoordinates<S>> for DoubledCoordinates<S>
type Output = DoubledCoordinates<S>
type Output = DoubledCoordinates<S>
The resulting type after applying the + operator.
sourceimpl<const S: DoubledSystem> AddAssign<DoubledCoordinates<S>> for DoubledCoordinates<S>
impl<const S: DoubledSystem> AddAssign<DoubledCoordinates<S>> for DoubledCoordinates<S>
sourceconst fn add_assign(&mut self, other: Self)
const fn add_assign(&mut self, other: Self)
Performs the += operation. Read more
sourceimpl<const S: DoubledSystem> Clone for DoubledCoordinates<S>
impl<const S: DoubledSystem> Clone for DoubledCoordinates<S>
sourcefn clone(&self) -> DoubledCoordinates<S>
fn clone(&self) -> DoubledCoordinates<S>
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<const S: DoubledSystem> Debug for DoubledCoordinates<S>
impl<const S: DoubledSystem> Debug for DoubledCoordinates<S>
sourceimpl<const S: DoubledSystem> Default for DoubledCoordinates<S>
impl<const S: DoubledSystem> Default for DoubledCoordinates<S>
sourcefn default() -> DoubledCoordinates<S>
fn default() -> DoubledCoordinates<S>
Returns the “default value” for a type. Read more
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<CubeCoordinates> for DoubledCoordinates<{ DoubledSystem::Height }>
impl From<CubeCoordinates> for DoubledCoordinates<{ DoubledSystem::Height }>
sourceconst fn from(_: CubeCoordinates) -> Self
const fn from(_: CubeCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<CubeCoordinates> for DoubledCoordinates<{ DoubledSystem::Width }>
impl From<CubeCoordinates> for DoubledCoordinates<{ DoubledSystem::Width }>
sourceconst fn from(_: CubeCoordinates) -> Self
const fn from(_: CubeCoordinates) -> Self
Converts to this type from the input type.
sourceimpl From<Direction> for DoubledCoordinates<{ DoubledSystem::Height }>
impl From<Direction> for DoubledCoordinates<{ DoubledSystem::Height }>
sourceimpl From<Direction> for DoubledCoordinates<{ DoubledSystem::Width }>
impl From<Direction> for DoubledCoordinates<{ DoubledSystem::Width }>
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::Height }>> for CubeCoordinates
impl From<DoubledCoordinates<{ DoubledSystem::Height }>> for CubeCoordinates
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<DoubledCoordinates<{ DoubledSystem::Width }>> for CubeCoordinates
impl From<DoubledCoordinates<{ DoubledSystem::Width }>> for CubeCoordinates
sourceconst fn from(_: DoubledCoordinates<{ DoubledSystem::Width }>) -> Self
const fn from(_: DoubledCoordinates<{ DoubledSystem::Width }>) -> Self
Converts to this type from the input type.
sourceimpl<const S: DoubledSystem> Mul<isize> for DoubledCoordinates<S>
impl<const S: DoubledSystem> Mul<isize> for DoubledCoordinates<S>
sourceimpl<const S: DoubledSystem> MulAssign<isize> for DoubledCoordinates<S>
impl<const S: DoubledSystem> MulAssign<isize> for DoubledCoordinates<S>
sourceconst fn mul_assign(&mut self, rhs: isize)
const fn mul_assign(&mut self, rhs: isize)
Performs the *= operation. Read more
sourceimpl<const S: DoubledSystem> PartialEq<DoubledCoordinates<S>> for DoubledCoordinates<S>
impl<const S: DoubledSystem> PartialEq<DoubledCoordinates<S>> for DoubledCoordinates<S>
sourcefn eq(&self, other: &DoubledCoordinates<S>) -> bool
fn eq(&self, other: &DoubledCoordinates<S>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl<const S: DoubledSystem> Sub<DoubledCoordinates<S>> for DoubledCoordinates<S>
impl<const S: DoubledSystem> Sub<DoubledCoordinates<S>> for DoubledCoordinates<S>
type Output = DoubledCoordinates<S>
type Output = DoubledCoordinates<S>
The resulting type after applying the - operator.
sourceimpl<const S: DoubledSystem> SubAssign<DoubledCoordinates<S>> for DoubledCoordinates<S>
impl<const S: DoubledSystem> SubAssign<DoubledCoordinates<S>> for DoubledCoordinates<S>
sourceconst fn sub_assign(&mut self, other: Self)
const fn sub_assign(&mut self, other: Self)
Performs the -= operation. Read more
impl<const S: DoubledSystem> Copy for DoubledCoordinates<S>
impl<const S: DoubledSystem> Eq for DoubledCoordinates<S>
impl<const S: DoubledSystem> StructuralEq for DoubledCoordinates<S>
impl<const S: DoubledSystem> StructuralPartialEq for DoubledCoordinates<S>
Auto Trait Implementations
impl<const S: DoubledSystem> RefUnwindSafe for DoubledCoordinates<S>
impl<const S: DoubledSystem> Send for DoubledCoordinates<S>
impl<const S: DoubledSystem> Sync for DoubledCoordinates<S>
impl<const S: DoubledSystem> Unpin for DoubledCoordinates<S>
impl<const S: DoubledSystem> UnwindSafe for DoubledCoordinates<S>
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