rust-sokoban/src/events.rs

24 lines
444 B
Rust
Raw Normal View History

2020-07-27 09:59:14 -04:00
#[derive(Debug)]
pub enum Event {
// Fired when the player hits an obstacle like a wall
PlayerHistObstacle,
// Fired when an entity is moved
EntityMoved(EntityMoved),
// Fired when the box is placed on a spot
BoxPlacedOnSpot(BoxPlacedOnSpot),
}
pub type EntityId = u32;
#[derive(Debug)]
pub struct EntityMoved {
pub id: EntityId,
}
#[derive(Debug)]
pub struct BoxPlacedOnSpot {
pub is_correct_spot: bool,
}