From e68420b6ef917e3827898614b402dd06069e9a0c Mon Sep 17 00:00:00 2001 From: Crizomb Date: Thu, 8 Jan 2026 23:49:41 +0100 Subject: [PATCH] perfect victory handling (panic) --- src/core/game_state.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); }