diff src/th06/enemy.rs @ 698:05e0425a8bc5

ecl_vm: enable SetDeathCallback.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 23 Aug 2019 02:37:21 +0200
parents 14fddc27e6f5
children 2a60f12bd5bd
line wrap: on
line diff
--- a/src/th06/enemy.rs
+++ b/src/th06/enemy.rs
@@ -57,8 +57,7 @@ impl std::ops::Sub<Position> for Positio
     }
 }
 
-#[derive(Debug, Clone)]
-struct Callback;
+type Callback = i32;
 
 #[derive(Debug, Clone)]
 /// XXX
@@ -251,10 +250,10 @@ pub struct Enemy {
     pub(crate) screen_box: Option<(f32, f32, f32, f32)>,
 
     // Callbacks.
-    death_callback: Option<Callback>,
-    boss_callback: Option<Callback>,
-    low_life_callback: Option<Callback>,
-    timeout_callback: Option<Callback>,
+    pub(crate) death_callback: Option<Callback>,
+    pub(crate) boss_callback: Option<Callback>,
+    pub(crate) low_life_callback: Option<Callback>,
+    pub(crate) timeout_callback: Option<Callback>,
 
     // Laser.
     pub(crate) laser_by_id: HashMap<u32, Laser>,