From fd2a4033aec48525d7ea72b108cd9d1707273ba3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 24 Mar 2021 17:02:26 +0000 Subject: [PATCH] deck: plumb goccults through to enabled Signed-off-by: Ian Jackson --- src/deck.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/deck.rs b/src/deck.rs index ea85d5ec..d6a80de3 100644 --- a/src/deck.rs +++ b/src/deck.rs @@ -55,12 +55,12 @@ impl PieceSpec for piece_specs::Deck { } impl Deck { - fn enabled(&self, gpc: &GPiece) -> bool { + fn enabled(&self, gpc: &GPiece, _goccults: &GameOccults) -> bool { gpc.occult.is_active() } fn current_face(&self, gpc: &GPiece) -> FaceId { - (self.enabled(gpc) as RawFaceId).into() + (gpc.occult.is_active() as RawFaceId).into() } } @@ -75,9 +75,9 @@ impl PieceTrait for Deck { } #[throws(IE)] - fn describe_html(&self, gpc: &GPiece, _goccults: &GameOccults) -> Html { + fn describe_html(&self, gpc: &GPiece, goccults: &GameOccults) -> Html { Html::lit( - if self.enabled(gpc) { ENABLED_DESC } else { DISABLED_DESC } + if self.enabled(gpc, goccults) { ENABLED_DESC } else { DISABLED_DESC } ) } @@ -89,9 +89,9 @@ impl PieceTrait for Deck { #[throws(InternalError)] fn add_ui_operations(&self, upd: &mut Vec, - _gs: &GameState, gpc: &GPiece) { + gs: &GameState, gpc: &GPiece) { upd.push( - if ! self.enabled(gpc) { + if ! self.enabled(gpc, &gs.occults) { UoDescription { kind: UoKind::Piece, def_key: 'A', @@ -129,7 +129,7 @@ impl PieceTrait for Deck { dbgc!("ui op k entry", &opname); let (xupdates, did) = - match (opname, self.enabled(gpc)) + match (opname, self.enabled(gpc, &goccults)) { ("activate", false) => { dbgc!("claiming"); -- 2.30.2