From: Ian Jackson Date: Wed, 7 Apr 2021 17:34:20 +0000 (+0100) Subject: rotateable: Provide PieceAngle::is_rotated X-Git-Tag: otter-0.5.0~135 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=52e2a7d7d4d5d3a5aafe95c90aa001444dcb04d6;p=otter.git rotateable: Provide PieceAngle::is_rotated Signed-off-by: Ian Jackson --- diff --git a/src/spec.rs b/src/spec.rs index c547f785..7ddf8b14 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -282,6 +282,12 @@ pub mod piece_specs { // ---------- Implementation - angles ---------- +impl PieceAngle { + pub fn is_rotated(&self) -> bool { match self { + &PieceAngle::Compass(CompassAngle(a)) => a != 0, + } } +} + impl Default for PieceAngle { fn default() -> Self { PieceAngle::Compass(default()) } }