use crate::pieces::{PieceSet, Side};
use std::cmp::PartialEq;
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum ThroneRule {
NoThrone,
NoPass,
KingPass,
NoEntry,
KingEntry
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum KingStrength {
Strong,
StrongByThrone,
Weak
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum KingAttack {
Armed,
Anvil,
Hammer
}
#[derive(Copy, Clone, Debug)]
pub struct HostilityRules {
pub(crate) throne: PieceSet,
pub(crate) corners: PieceSet,
pub(crate) edge: PieceSet
}
#[derive(Clone, Copy, Debug)]
pub struct ShieldwallRules {
pub corners_may_close: bool,
pub captures: PieceSet
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum EnclosureWinRules {
WithEdgeAccess,
WithoutEdgeAccess,
}
#[derive(Clone, Copy, Debug)]
pub struct RepetitionRule {
pub(crate) n_repetitions: usize,
pub(crate) is_loss: bool
}
#[derive(Copy, Clone, Debug)]
pub struct Ruleset {
pub edge_escape: bool,
pub king_strength: KingStrength,
pub king_attack: KingAttack,
pub shieldwall: Option<ShieldwallRules>,
pub exit_fort: bool,
pub throne_movement: ThroneRule,
pub may_enter_corners: PieceSet,
pub hostility: HostilityRules,
pub slow_pieces: PieceSet,
pub starting_side: Side,
pub enclosure_win: Option<EnclosureWinRules>,
pub repetition_rule: Option<RepetitionRule>,
pub draw_on_no_plays: bool,
pub linnaean_capture: bool,
}