diff --git a/src/core/game_state.rs b/src/core/game_state.rs index 0e12a1b..4b44747 100644 --- a/src/core/game_state.rs +++ b/src/core/game_state.rs @@ -10,7 +10,7 @@ pub struct EndGameEvent { pub reason: EndGameReason, } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum EndGameReason { Die, Victory, @@ -72,6 +72,10 @@ struct ResetWorldEvent; fn on_end_game(event: On, mut commands: Commands) { let reason = event.reason; println!("end game reason {:?}", reason); + + if reason == EndGameReason::Victory { + panic!("You win! But you panic still"); + } commands.trigger(ResetWorldEvent); }