pub struct ICoord {
pub x: i32,
pub y: i32,
}Expand description
General purpose icoordinate
Fields§
§x: i32§y: i32Implementations§
Source§impl ICoord
impl ICoord
pub const fn new(x: i32, y: i32) -> Self
pub const fn from_ucoord(ucoord: UCoord) -> Self
pub fn to_ucoord(self) -> UCoord
pub const fn normalize(self, ucoord: UCoord) -> Self
pub const fn is_valid(self, ucoord: UCoord) -> bool
pub const fn constrain(self, ucoord: UCoord) -> Option<Self>
pub const fn get(self, axis: Axis) -> i32
pub fn get_mut(&mut self, axis: Axis) -> &mut i32
pub fn with_axis<F: FnMut(i32) -> i32>(self, axis: Axis, f: F) -> Self
pub const fn set(self, axis: Axis, value: i32) -> Self
pub fn set_in_place(&mut self, axis: Axis, value: i32)
pub const fn new_axis(this_axis: i32, other_axis: i32, axis: Axis) -> Self
pub fn get_static<A: StaticAxis>(self) -> i32
pub fn get_static_mut<A: StaticAxis>(&mut self) -> &mut i32
pub fn with_static_axis<A: StaticAxis, F: FnMut(i32) -> i32>(self, f: F) -> Self
pub fn set_static<A: StaticAxis>(self, value: i32) -> Self
pub fn set_static_in_place<A: StaticAxis>(&mut self, value: i32)
pub fn new_static_axis<A: StaticAxis>(this_axis: i32, other_axis: i32) -> Self
pub const fn set_x(self, x: i32) -> Self
pub const fn set_y(self, y: i32) -> Self
pub fn set_x_in_place(&mut self, x: i32)
pub fn set_y_in_place(&mut self, y: i32)
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: i32) -> Option<Self>
pub fn checked_div(self, rhs: i32) -> Option<Self>
pub const fn magnitude2(self) -> u32
pub const fn distance2(self, other: Self) -> u32
pub const fn manhattan_magnitude(self) -> u32
pub const fn manhattan_distance(self, other: Self) -> u32
pub const fn opposite(self) -> Self
pub const fn left90(self) -> Self
pub const fn right90(self) -> Self
pub const fn cardinal_left45(self) -> Self
pub const fn cardinal_right45(self) -> Self
pub const fn cardinal_left135(self) -> Self
pub const fn cardinal_right135(self) -> Self
pub const fn is_zero(self) -> bool
pub fn pairwise_max(self, other: Self) -> Self
pub fn pairwise_min(self, other: Self) -> Self
pub const fn transpose(self) -> Self
Trait Implementations§
Source§impl<T> AddAssign<T> for ICoord
impl<T> AddAssign<T> for ICoord
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+= operation. Read moreSource§impl<T> DivAssign<T> for ICoord
impl<T> DivAssign<T> for ICoord
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T> MulAssign<T> for ICoord
impl<T> MulAssign<T> for ICoord
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl Ord for ICoord
impl Ord for ICoord
Source§impl PartialOrd for ICoord
impl PartialOrd for ICoord
Source§impl<T> SubAssign<T> for ICoord
impl<T> SubAssign<T> for ICoord
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-= operation. Read moreimpl Copy for ICoord
impl Eq for ICoord
impl StructuralPartialEq for ICoord
Auto Trait Implementations§
impl Freeze for ICoord
impl RefUnwindSafe for ICoord
impl Send for ICoord
impl Sync for ICoord
impl Unpin for ICoord
impl UnwindSafe for ICoord
Blanket Implementations§
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