pub enum Direction {
Down,
Up,
North,
South,
West,
East,
}Expand description
The six cardinal directions / face directions.
Variants§
Implementations§
Source§impl Direction
impl Direction
Sourcepub fn rotate_x(self, degrees: i32) -> Direction
pub fn rotate_x(self, degrees: i32) -> Direction
Rotate this direction by X rotation (around X axis, in 90-degree increments). Looking from +X towards origin, positive rotation goes Up -> North -> Down -> South.
Sourcepub fn rotate_y(self, degrees: i32) -> Direction
pub fn rotate_y(self, degrees: i32) -> Direction
Rotate this direction by Y rotation (around Y axis, in 90-degree increments). Looking from +Y (above), positive rotation goes North -> East -> South -> West.
Sourcepub fn rotate_by_transform(self, x_rot: i32, y_rot: i32) -> Direction
pub fn rotate_by_transform(self, x_rot: i32, y_rot: i32) -> Direction
Rotate this direction by a block transform (X then Y rotation).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Direction
impl<'de> Deserialize<'de> for Direction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Direction
impl Eq for Direction
impl StructuralPartialEq for Direction
Auto Trait Implementations§
impl Freeze for Direction
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnwindSafe for Direction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.