euv-engine 0.10.0

A high-performance 2D game engine built on the euv framework, featuring ECS, fixed-timestep game loop, canvas rendering, physics, collision detection, sprite animation, and audio.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::*;

/// A reference-counted, interior-mutable handle to a `dyn Component` trait object.
pub type ComponentRc = Rc<RefCell<dyn Component>>;

/// A reference-counted, interior-mutable handle to an `Entity`.
pub type EntityRc = Rc<RefCell<Entity>>;

/// A handler function that processes an `EntityEvent`.
pub type EventHandler = Rc<dyn Fn(&EntityEvent)>;

/// A map from event name to the list of registered handler closures.
pub type EventHandlers = HashMap<String, Vec<EventHandler>>;