extern crate topaz; use std::rc::Rc; pub struct HelloWorldSystem; impl topaz::System for HelloWorldSystem { fn operate(&self, universe: &mut topaz::Universe, _: Rc) { println!("Hello World!"); universe.do_event(E::with_id(topaz::EVENT_QUIT)); } } fn main() { let mut universe:topaz::Universe = topaz::Universe::new(()); universe.add_and_subscribe(Rc::new(HelloWorldSystem{}),vec![topaz::EVENT_INIT]); universe.run(); }