kroz-rs/src/state.rs

23 lines
441 B
Rust

use crate::graphics::draw;
use crate::input::handle;
use crate::systems::*;
use bracket_lib::prelude::*;
use specs::prelude::*;
pub struct State {
world: World,
}
impl GameState for State {
fn tick(&mut self, bterm: &mut BTerm) {
handle(&self.world, bterm);
run_systems(&mut self.world);
draw(&self.world, bterm);
}
}
impl State {
pub fn new(world: World) -> Self {
State { world }
}
}