forked from nonsensical-dev/zenyx-engine
cube
This commit is contained in:
parent
7ec772e011
commit
3941535f7d
7 changed files with 430 additions and 16 deletions
|
@ -1,3 +1,15 @@
|
|||
// struct ComponentRegistry {
|
||||
// components
|
||||
// }
|
||||
|
||||
|
||||
pub trait Component: Sized + 'static {
|
||||
fn update(&mut self, delta_time: f32);
|
||||
fn serialize(&self) -> Vec<u8>;
|
||||
fn deserialize(data: &[u8;6]) -> Self;
|
||||
}
|
||||
|
||||
pub trait Entity: Sized {
|
||||
fn add_component<C: Component>(&mut self, component: C);
|
||||
fn remove_component<C: Component>(&mut self);
|
||||
fn get_component<C: Component>(&self) -> Option<&C>;
|
||||
fn serialize(&self) -> Vec<u8>;
|
||||
fn deserialize(data: &[u8;6]) -> Self;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue