From 3577c4fb1515895054f00b02365845ef206f5852 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 28 Feb 2021 15:32:52 +0000 Subject: [PATCH] Introduce OccultedPieceTrait as a thing that a piece can do Nothing impls or calls this yet. Signed-off-by: Ian Jackson --- src/gamestate.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gamestate.rs b/src/gamestate.rs index 33294c1d..8851bead 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -155,6 +155,8 @@ pub trait PieceTrait: OutlineTrait + Send + Debug + 'static { fn describe_html(&self, gpc: &GPiece) -> Result; + fn occultable(&self) -> Option<&dyn OccultedPieceTrait> { None } + fn delete_hook(&self, _p: &GPiece, _gs: &mut GameState) -> ExecuteGameChangeUpdates { ExecuteGameChangeUpdates{ pcs: vec![], log: vec![], raw: None } @@ -163,6 +165,11 @@ pub trait PieceTrait: OutlineTrait + Send + Debug + 'static { fn itemname(&self) -> &str; } +pub trait OccultedPieceTrait: OutlineTrait + 'static { + fn svg(&self, f: &mut Html, id: VisiblePieceId) -> Result<(),IE>; + fn describe_html(&self) -> Result; +} + #[derive(Debug)] pub struct ApiPieceOpArgs<'a> { pub gs: &'a mut GameState, -- 2.30.2