mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/block/mod.rs')
| -rw-r--r-- | src/block/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/block/mod.rs b/src/block/mod.rs index ddfa58b..da52426 100644 --- a/src/block/mod.rs +++ b/src/block/mod.rs @@ -3,6 +3,7 @@ //! categorized as mindustry categorizes them in its assets folder, for easy drawing. //! //! with the exception of sandbox, that is. +use bobbin_bits::U4::{self, *}; use std::any::Any; use std::borrow::Cow; use std::error::Error; @@ -307,6 +308,17 @@ impl Rotation { } #[must_use] + /// mask + pub fn mask(self) -> U4 { + match self { + Rotation::Up => B1000, + Rotation::Right => B0100, + Rotation::Down => B0010, + Rotation::Left => B0001, + } + } + + #[must_use] /// character of this rot (Right => >, Up => ^, Left => <, Down => v) pub fn ch(self) -> char { match self { |