From 9c118cca1f94866481c8d8ca8b43c9153c484c47 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 29 Sep 2020 21:20:24 +0100 Subject: [PATCH] Introduce UoKind Signed-off-by: Ian Jackson --- src/gamestate.rs | 5 +++++ 1 file changed, 5 insertions(+) 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"), -- 2.30.2