chiark / gitweb /
Introduce UoKind
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 29 Sep 2020 20:20:24 +0000 (21:20 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 29 Sep 2020 20:20:24 +0000 (21:20 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/gamestate.rs

index c1bc6562d224af7026142f0f593a770f17ff8e7f..f2a2ede0f9811d5d03cd9d0a80cef252e89f2ee2 100644 (file)
@@ -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<T> 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"),