From: Ian Jackson Date: Tue, 29 Sep 2020 20:20:24 +0000 (+0100) Subject: Introduce UoKind X-Git-Tag: otter-0.2.0~818 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9c118cca1f94866481c8d8ca8b43c9153c484c47;p=otter.git Introduce UoKind Signed-off-by: Ian Jackson --- diff --git a/src/gamestate.rs b/src/gamestate.rs index c1bc6562..f2a2ede0 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -88,10 +88,14 @@ pub trait Outline : Send + Debug { fn bbox_approx(&self) -> [Pos;2]; } +#[derive(Debug,Copy,Clone,Serialize,Deserialize)] +pub enum UoKind { Global, Piece, } + pub type UoKey = char; #[derive(Debug,Clone,Serialize,Deserialize)] pub struct UoDescription { + pub kind: UoKind, pub def_key: UoKey, pub opname: String, pub desc: Html, @@ -264,6 +268,7 @@ impl PieceExt for T where T: Piece + ?Sized { let mut out = vec![]; if self.nfaces() > 1 { out.push(UoDescription { + kind: UoKind::Global, def_key: 'f'.into(), opname: "flip".to_string(), desc: Html::lit("flip"),