sanity
This commit is contained in:
@@ -244,6 +244,7 @@ impl<Ctx: 'static> Event<Ctx> for Senses {
|
|||||||
|
|
||||||
impl<Ctx: 'static> EventModule<Ctx, Senses> for SensorModule<Ctx> {
|
impl<Ctx: 'static> EventModule<Ctx, Senses> for SensorModule<Ctx> {
|
||||||
fn register(&mut self, id: Id, senses: Senses, f: impl EventFn<Ctx, SenseData>) {
|
fn register(&mut self, id: Id, senses: Senses, f: impl EventFn<Ctx, SenseData>) {
|
||||||
|
// TODO: does not add to active if currently active
|
||||||
self.map.entry(id).or_default().sensors.push(Sensor {
|
self.map.entry(id).or_default().sensors.push(Sensor {
|
||||||
senses,
|
senses,
|
||||||
f: Box::new(f),
|
f: Box::new(f),
|
||||||
@@ -258,11 +259,7 @@ impl<Ctx: 'static> Event<Ctx> for Sense {
|
|||||||
|
|
||||||
impl<Ctx: 'static> EventModule<Ctx, Sense> for SensorModule<Ctx> {
|
impl<Ctx: 'static> EventModule<Ctx, Sense> for SensorModule<Ctx> {
|
||||||
fn register(&mut self, id: Id, sense: Sense, f: impl EventFn<Ctx, SenseData>) {
|
fn register(&mut self, id: Id, sense: Sense, f: impl EventFn<Ctx, SenseData>) {
|
||||||
// TODO: does not add to active if currently active
|
self.register(id, Senses::from(sense), f);
|
||||||
self.map.entry(id).or_default().sensors.push(Sensor {
|
|
||||||
senses: sense.into(),
|
|
||||||
f: Box::new(f),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user