From 8bc973dcb907fb745bf9c3535db434b53330be40 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 15 Apr 2022 12:28:57 +0100 Subject: [PATCH] Special client rendering: Do explain why not to provide xdata here Signed-off-by: Ian Jackson --- src/gamestate.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gamestate.rs b/src/gamestate.rs index e649864b..c35b0f7b 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -180,6 +180,10 @@ pub trait PieceBaseTrait: OutlineTrait + Send + Debug + 'static { fn itemname(&self) -> &str; + // Don't add an xdata argument to this. Implementors must not make + // this depend on the piece state, because the piece state might change + // between svg() (which sets up information in the DOM) and special() + // (which arranges to use that information). fn special(&self) -> Result,IE> { Ok(None) } } -- 2.30.2