From 8e4ed1a20030b303749f6af22e14013f78bc9889 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 5 Jul 2021 20:55:38 +0100 Subject: [PATCH] ui: break out occultation_notify_update_image Signed-off-by: Ian Jackson --- src/deck.rs | 7 +------ src/ui.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/deck.rs b/src/deck.rs index f2b7856f..c47f53e3 100644 --- a/src/deck.rs +++ b/src/deck.rs @@ -242,11 +242,6 @@ impl PieceTrait for Deck { } fn occultation_notify_hook(&self, piece: PieceId) -> UnpreparedUpdates { - Some(Box::new( - move |updates: &mut PrepareUpdatesBuffer| { - updates.piece_update_image(piece, &None) - .unwrap_or_else(|e| error!("unable to send update! {:?}", e)) - } - )) + occultation_notify_update_image(piece) } } diff --git a/src/ui.rs b/src/ui.rs index 378aaa46..38c89e4e 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -42,6 +42,16 @@ pub fn player_dasharray(gplayers: &GPlayers, player: PlayerId) -> Html { player_num_dasharray(n) } +pub fn occultation_notify_update_image(piece: PieceId) + -> UnpreparedUpdates { + Some(Box::new( + move |updates: &mut PrepareUpdatesBuffer| { + updates.piece_update_image(piece, &None) + .unwrap_or_else(|e| error!("unable to send update! {:?}", e)) + } + )) +} + impl PresentationLayout { pub fn template(self) -> &'static str { match self { -- 2.30.2