use std::{
fmt::Debug,
time::Duration,
};
use crate::{
events::Events,
render::{
command::RenderCommand,
RenderContext,
},
};
pub trait Component<R, E>
where
R: Sized + Debug,
E: Sized + Debug,
{
fn on_attach(&mut self, render_context: &mut RenderContext) -> Result<R, E>;
fn on_detach(&mut self, render_context: &mut RenderContext) -> Result<R, E>;
fn on_event(&mut self, event: Events) -> Result<R, E>;
fn on_update(&mut self, last_frame: &Duration) -> Result<R, E>;
fn on_render(
&mut self,
render_context: &mut RenderContext,
) -> Vec<RenderCommand>;
}