This is currently empty.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
last_released: default(),
rotateable: true,
};
- let SpecLoaded { p, occultable } =
+ let SpecLoaded { p, occultable, special } =
info.load(piece_i as usize, &mut gpc, ig, SpecDepth::zero())?;
if p.nfaces() <= face.into() {
throw!(SpecError::FaceNotFound);
ilks.load_lilk(lilk, data)
});
ig.ipieces.as_mut(modperm).insert(piece, IPiece {
- p, occilk,
+ p, occilk, special,
});
updates.push((piece, PieceUpdateOp::Insert(())));
})(); // <- no ?, infallible (to avoid leaking ilk)
SpecLoaded {
p: Box::new(clock),
occultable: None,
+ special: default(),
}
}
}
itemname, qty, min_unit,
};
- SpecLoaded { p: Box::new(bnote) as _, occultable: None }
+ SpecLoaded { p: Box::new(bnote) as _, occultable: None,
+ special: default() }
}
}
SpecLoaded {
p,
occultable: None,
+ special: default(),
}
}
}
SpecLoaded {
p: Box::new(die) as _,
occultable,
+ special: default(),
}
}
}
pub struct SpecLoaded {
pub p: Box<dyn PieceTrait>,
pub occultable: PieceSpecLoadedOccultable,
+ pub special: PieceSpecialProperties,
}
#[derive(Debug)]
pub struct SpecLoadedInert {
pub type PieceSpecLoadedOccultable =
Option<(LOccultIlk, Arc<dyn InertPieceTrait>)>;
+/// Special handling instructions for this piece
+///
+/// These remain constant after the piece has been loaded,
+/// so they are mostly "can/do we do this thing".
+#[derive(Debug,Clone,Default,Serialize,Deserialize)]
+pub struct PieceSpecialProperties {
+}
+
#[typetag::serde(tag="type")]
pub trait PieceSpec: Debug + Sync + Send + 'static {
#[throws(SpecError)]
pub struct IPiece {
pub p: IPieceTraitObj,
pub occilk: Option<IOccultIlk>,
+ #[serde(default)] pub special: PieceSpecialProperties,
}
deref_to_field!{IPiece, IPieceTraitObj, p}
SpecLoaded {
p,
occultable: None,
+ special: default(),
}
}
}
SpecLoaded {
p: Box::new(self.load_raw()?.0),
occultable: None,
+ special: default(),
}
}
SpecLoaded {
p,
occultable,
+ special: default(),
}
}
}