#![allow(dead_code, unused_imports)]
#[derive(Debug, Default)]
pub struct TurnState {
current_phase: Phase,
current_turn: usize,
}
impl TurnState {
pub fn phase(&self) -> Phase {
self.current_phase
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum Phase {
#[default]
Ready,
Standby,
Draw,
PrecombatMain,
Battle(BattleStep),
PostcombatMain,
End,
}
impl Phase {
pub fn is_closed(self) -> bool {
matches!(
self,
Phase::Ready | Phase::Battle(BattleStep::ResolveDamage)
)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum BattleStep {
BeginBattle,
DeclareAttackers,
MakeAttacks,
ResolveDamage,
EndBattle,
}