Export Movement and some useful Movement aliases
This commit is contained in:
parent
af682d88ff
commit
41df73bafc
|
@ -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
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
Loading…
Reference in New Issue