From: Ian Jackson Date: Tue, 16 Mar 2021 22:54:49 +0000 (+0000) Subject: Some comments X-Git-Tag: otter-0.5.0~690 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=aec5849ac903ff51e11085e1b99ca0c34192d335;p=otter.git Some comments Signed-off-by: Ian Jackson --- diff --git a/src/gamestate.rs b/src/gamestate.rs index 548f862d..8c8c0f25 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -150,6 +150,9 @@ pub trait PieceTrait: OutlineTrait + Send + Debug + 'static { _was_held: Option) -> UnpreparedUpdates { None } + /// Not called if the whole game is destroyed. + /// You can use Drop of course but it's not usually much use since + /// you don't have a reference to the game or anything. fn delete_hook(&self, _p: &GPiece, _gs: &mut GameState) -> ExecuteGameChangeUpdates { ExecuteGameChangeUpdates{ pcs: vec![], log: vec![], raw: None } diff --git a/src/global.rs b/src/global.rs index 78408d78..efcef687 100644 --- a/src/global.rs +++ b/src/global.rs @@ -1104,6 +1104,9 @@ impl InstanceGuard<'_> { }; let gref = InstanceRef(Arc::new(Mutex::new(cont))); let mut g = gref.lock().unwrap(); + + // xxx add hook to let chess clock restart after reload + for (token, _) in &tokens_players { g.tokens_players.tr.insert(RawToken(token.clone())); }