Split engine object
This commit is contained in:
parent
2c00285217
commit
1517aa11d0
1 changed files with 8 additions and 6 deletions
|
@ -29,14 +29,9 @@ pub enum EngineEvent {
|
||||||
FileDrop(String),
|
FileDrop(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait EngineObject: Any {
|
pub trait EngineObjectHelper: Any {
|
||||||
type Payload: Send + Sync;
|
type Payload: Send + Sync;
|
||||||
|
|
||||||
fn name(&self) -> &str;
|
|
||||||
|
|
||||||
fn update(&mut self) -> Result<()>;
|
|
||||||
fn event(&mut self, event: EngineEvent) -> Result<()>;
|
|
||||||
|
|
||||||
fn access(&self) -> EngineObjectAccess<'_, Self::Payload>;
|
fn access(&self) -> EngineObjectAccess<'_, Self::Payload>;
|
||||||
fn payload(&self) -> EngineObjectDataHandle<Self::Payload>;
|
fn payload(&self) -> EngineObjectDataHandle<Self::Payload>;
|
||||||
fn ui(&self) -> &States;
|
fn ui(&self) -> &States;
|
||||||
|
@ -97,6 +92,13 @@ pub trait EngineObject: Any {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub trait EngineObject: Any {
|
||||||
|
fn name(&self) -> &str;
|
||||||
|
|
||||||
|
fn update(&mut self) -> Result<()>;
|
||||||
|
fn event(&mut self, event: EngineEvent) -> Result<()>;
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Input {
|
pub struct Input {
|
||||||
pub direction_mapping: HashMap<Keycode, GuiDirection>,
|
pub direction_mapping: HashMap<Keycode, GuiDirection>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue