chiark / gitweb /
currency: Rename to show_to_player
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 19 May 2022 19:57:09 +0000 (20:57 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 19 May 2022 19:57:27 +0000 (20:57 +0100)
This is how it's going to be when we occult.

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

index 7bce5bdfd6070eb77baab9eeec644390364cd1df..8d3f01a8ddf149dc25e200340cfce9b84d0ad720 100644 (file)
@@ -218,12 +218,14 @@ impl PieceTrait for Banknote {
         // Occultation::get_kind ?
         throw!();
       }
+      let show_to_player = show;
 
       // Our position is within its bbox
-      if ! mipc.show(show).abs_bbox(mgpc).ok()?.contains(tgpc.pos) { throw!() }
+      if ! mipc.show(show_to_player).abs_bbox(mgpc).ok()?
+        .contains(tgpc.pos) { throw!() }
 
       // It's a banknote
-      let mself: &Banknote = mipc.p.show(show)
+      let mself: &Banknote = mipc.p.show(show_to_player)
         .downcast_piece_fastsplit().ok()?;
 
       // Of our currency
@@ -232,7 +234,7 @@ impl PieceTrait for Banknote {
 
       // We are in the ellipse inscribed in its bbox
       let delta = (tgpc.pos - mgpc.pos).ok()?.promote();
-      let bbox_sz = mipc.show(show).bbox_approx().ok()?;
+      let bbox_sz = mipc.show(show_to_player).bbox_approx().ok()?;
       let dist2: f64 = (0..2).map(|i| {
         // The bbox may not be centred.  We imagine a quarter ellipse
         // inscribed in each corner, with the centre at the nominal position.