mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/block/mod.rs')
-rw-r--r--src/block/mod.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/block/mod.rs b/src/block/mod.rs
index 0afe8f6..ddfa58b 100644
--- a/src/block/mod.rs
+++ b/src/block/mod.rs
@@ -291,23 +291,19 @@ impl RegistryEntry for Block {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
/// the possible rotation states of a object
+#[repr(u8)]
pub enum Rotation {
- Right,
Up,
- Left,
+ Right,
Down,
+ Left,
}
impl Rotation {
#[must_use]
/// count rotations
pub fn count(self) -> u8 {
- match self {
- Self::Up => 0,
- Self::Right => 1,
- Self::Down => 2,
- Self::Left => 3,
- }
+ self as u8
}
#[must_use]