Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
i: 0,
})
.context("load")?;
+ p.loaded_hook_preview(&mut gpc)?;
// todo show occulted version too
let mut uos = vec![];
p.add_ui_operations(VIS, &mut uos, &GameState::dummy(), &GPiece::dummy())
, _: &InstanceRef) {
self.cooldown_cleanup_hook(&mut gs.pieces, piece)?;
}
+
+ #[throws(IE)]
+ fn loaded_hook_preview(&self, gpc: &mut GPiece) {
+ let state: &mut State = gpc.xdata.get_mut_exp()?;
+ state.cooldown_expires = Some(FutureInstant::try_from(
+ Duration::from_secs_f64(
+ self.cooldown_time.as_secs_f64() * 0.25
+ )
+ )?)
+//.map_err(|e| internal_error_bydebug(&e))?
+ }
}
#[typetag::serde(name="Die")]
Ok(())
}
+ fn loaded_hook_preview(&self, _gpc: &mut GPiece) -> Result<(),IE> {
+ Ok(())
+ }
+
/// 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.