properties: rewrite properties (whoops)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use core::fmt;
|
||||
|
||||
use crate::events::{Event, EventBus, Variant};
|
||||
use crate::{events::{Event, EventBus}, properties::{Variant, PropertyID}};
|
||||
|
||||
pub trait Task: Send {
|
||||
fn on_ready(&mut self, bus: &mut EventBus) {}
|
||||
fn on_tick(&mut self, bus: &mut EventBus) {}
|
||||
fn on_property_change(&mut self, key: &'static str, value: &Variant, bus: &mut EventBus) {}
|
||||
fn on_property_change(&mut self, key: PropertyID, value: &Variant, bus: &mut EventBus) {}
|
||||
|
||||
fn start(&mut self, bus: &mut EventBus) {}
|
||||
fn stop(&mut self, bus: &mut EventBus) {}
|
||||
@@ -80,7 +80,7 @@ impl ScheduledTask {
|
||||
match event {
|
||||
Event::Tick => self.task.on_tick(bus),
|
||||
Event::ReadyToRock => self.task.on_ready(bus),
|
||||
Event::PropertyChange(key, value) => self.task.on_property_change(key, value, bus),
|
||||
Event::PropertyChange(key, value) => self.task.on_property_change(key.clone(), value, bus),
|
||||
_ => ()
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user