chiark / gitweb /
Currency: Declare to be multigrab
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 18 Apr 2022 11:38:14 +0000 (12:38 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 18 Apr 2022 12:37:02 +0000 (13:37 +0100)
We don't actually implement the PieceTrait method, so that just
returns Inapplicable.  Ie, after this you can try to multiselect a
banknote but you get
  Problem manipulating piece: UI operation not valid in the curret piece state
in the log.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/currency.rs

index c14360b8042a0086acd49551eafd8744e7a6d42c..a26e4236ab1c0bcb6c1502e0f183df385f459d1f 100644 (file)
@@ -69,8 +69,11 @@ impl PieceSpec for Spec {
       itemname, qty, min_unit,
     };
 
-    SpecLoaded { p: Box::new(bnote) as _, occultable: None,
-                 special: default() }
+    let special = PieceSpecialProperties {
+      multigrab: true,
+      ..default()
+    };
+    SpecLoaded { p: Box::new(bnote) as _, occultable: None, special }
   }
 }