1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Time management plugin for turn-based games (ADR 005 compliant)
//!
//! This plugin provides:
//! - `TurnPhase`: Global state for turn-based flow control
//! - `GameDate`: Resource tracking current day and ticks
//! - `AnimationLock`: RAII component for automatic visual synchronization
//! - `NextTurnPhase`: Resource for flexible phase transition
//! - `AdvanceTimeRequested`, `DayChanged`, `TickAdvanced`: Messages for time events
//!
//! # Architecture
//!
//! The time plugin follows ADR 005 (Event-Driven Hybrid Turn Architecture):
//! - **Global Phase Management**: `TurnPhase` State controls macro flow
//! - **RAII Visual Lock Pattern**: `AnimationLock` Component for automatic release
//! - **Event-driven**: Messages for loose coupling
//! - **Flexible Transition**: `NextTurnPhase` for booking next phase
//!
//! # Usage Example
//!
//! ```ignore
//! use bevy::prelude::*;
//! use issun_bevy::plugins::time::{TimePlugin, TurnPhase, GameDate, AdvanceTimeRequested};
//!
//! // Register the plugin
//! App::new()
//! .add_plugins(TimePlugin::default())
//! .add_systems(Update, my_system.run_if(in_state(TurnPhase::PlayerInput)))
//! .run();
//!
//! // Advance time
//! fn end_turn_system(mut commands: Commands) {
//! commands.write_message(AdvanceTimeRequested);
//! }
//!
//! // React to day changes
//! fn settlement_system(mut messages: MessageReader<DayChanged>) {
//! for msg in messages.read() {
//! println!("Day {} has begun!", msg.day);
//! }
//! }
//!
//! // Spawn animation lock (RAII pattern)
//! fn damage_animation(mut commands: Commands) {
//! commands.spawn(AnimationLock::new(0.5, "damage_flash"));
//! }
//! ```
pub use AnimationLock;
pub use ;
pub use TimePlugin;
pub use ;
pub use TurnPhase;
pub use ;