feat(engine,core): add elapsed-time tick system and Zen GameMode

Phase 6 part 4 (partial):
- GameState now tracks elapsed_seconds via tick_elapsed_time in GamePlugin
  (per-second increment while not won). Pure helper advance_elapsed makes
  the tick logic directly testable without mocking Bevy Time.
- New GameMode enum (Classic / Zen) on GameState. Zen mode suppresses
  scoring in move_cards and undo. GameState::new_with_mode allows callers
  to construct non-Classic games; the existing GameState::new still
  defaults to Classic. mode is serde(default) for backwards-compatible
  persistence.
- NewGameRequestEvent gains an optional mode field; handle_new_game
  honours it (falling back to the current game's mode when None).
- InputPlugin: pressing Z starts a fresh Zen-mode game.

Time Attack, Challenge mode, level-5 unlock gating, and unlock UI are
still deferred.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-04-25 14:14:57 -07:00
parent 6b793aa2ab
commit 8afb1f3fe5
6 changed files with 79 additions and 12 deletions
+3
View File
@@ -1,6 +1,7 @@
//! Cross-system events used by the engine's plugins.
use bevy::prelude::Event;
use solitaire_core::game_state::GameMode;
use solitaire_core::pile::PileType;
/// Request to move `count` cards from `from` to `to`. Fired by input systems,
@@ -21,9 +22,11 @@ pub struct DrawRequestEvent;
pub struct UndoRequestEvent;
/// Request to start a new game. `seed = None` uses a system-time seed.
/// `mode = None` reuses the current game's `GameMode`.
#[derive(Event, Debug, Clone, Copy, Default)]
pub struct NewGameRequestEvent {
pub seed: Option<u64>,
pub mode: Option<GameMode>,
}
/// Fired by `GamePlugin` after any successful state mutation. Rendering and