Skip to main content

euv_engine/entity/
type.rs

1use crate::*;
2
3/// A reference-counted, interior-mutable handle to a `dyn Component` trait object.
4pub type ComponentRc = Rc<RefCell<dyn Component>>;
5
6/// A reference-counted, interior-mutable handle to an `Entity`.
7pub type EntityRc = Rc<RefCell<Entity>>;
8
9/// A handler function that processes an `EntityEvent`.
10pub type EventHandler = Rc<dyn Fn(&EntityEvent)>;
11
12/// A map from event name to the list of registered handler closures.
13pub type EventHandlers = HashMap<String, Vec<EventHandler>>;