chiark / gitweb /
Genericise SpecLoaded
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 12 Apr 2022 00:12:48 +0000 (01:12 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 12 Apr 2022 00:12:48 +0000 (01:12 +0100)
We are going to want to make inert pieces occultable too.  Currently
this is meaningless since we only call load_inert when resolving the
occultation for *another* piece.  But that is going to change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/gamestate.rs

index 6f229f209d3f6b07d43e6206ceb0fb9e76d80fd5..1f2fbfec5b96eade1717f20bd6e797420ef3c083 100644 (file)
@@ -261,10 +261,11 @@ pub struct ApiPieceOpArgs<'a> {
 }
 
 #[derive(Debug)]
-pub struct PieceSpecLoaded {
-  pub p: Box<dyn PieceTrait>,
+pub struct SpecLoaded<PT: ?Sized> {
+  pub p: Box<PT>,
   pub occultable: PieceSpecLoadedOccultable,
 }
+pub type PieceSpecLoaded = SpecLoaded<dyn PieceTrait>;
 pub type PieceSpecLoadedOccultable =
   Option<(OccultIlkName, Arc<dyn InertPieceTrait>)>;