Export Movement and some useful Movement aliases

This commit is contained in:
tali 2022-12-14 15:29:00 -05:00
parent af682d88ff
commit 41df73bafc
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,13 @@ pub enum Movement {
}
impl Movement {
pub const DROP: Movement = Movement::Drop;
pub const LEFT: Movement = Movement::Shift(Horizontal::Left);
pub const RIGHT: Movement = Movement::Shift(Horizontal::Right);
pub const CW: Movement = Movement::Rotate(Spin::Cw);
pub const CCW: Movement = Movement::Rotate(Spin::Ccw);
pub const FLIP: Movement = Movement::Rotate(Spin::Flip);
/// Applies this movement to the given piece on the given matrix. Returns true if the
/// movement was successful, or false if the piece did not move because it was
/// obstructed by the matrix. `piece` will be modified in-place iff the return value

View File

@ -4,6 +4,7 @@ pub mod input;
pub mod matrix;
pub mod piece;
pub use input::Movement;
pub use matrix::Mat;
pub use piece::{Loc, Piece, Rot};