use crate::{
  dice::{AbstractDices, Dices},
  element::Element,
  event::EventSpeed,
};
use once_cell::sync::Lazy;

const CARD_REDRAW_CHANCES: usize = 1;
const DECK_CARDS_REQUIREMENT: usize = 30;
const DECK_CARD_LIMIT_PER_KIND: usize = 2;
const DECK_CHARS_REQUIREMENT: usize = 3;
const DECK_CHAR_LIMIT_PER_KIND: usize = 1;
const DICE_LIMIT: usize = 16;
const DICE_REROLL_CHANCES: usize = 1;
const HAND_CARD_LIMIT: usize = 10;
const MAX_CARDS_PER_KIND: usize = 2;
const ROUND_LIMIT: usize = 15;
const SUMMONS_LIMIT: usize = 4;
const SUPPORTS_LIMIT: usize = 4;
const SWAP_COST: Lazy<AbstractDices> = Lazy::new(|| AbstractDices::new_from_element_iter([Element::ANY; 1].into_iter()));
const SWAP_SPEED: EventSpeed = EventSpeed::Combat;

pub struct Mode {
  card_redraw_chances: usize,
  deck_cards_requirement: usize,
  deck_card_limit_per_kind: usize,
  deck_chars_requirement: usize,
  deck_char_limit_per_kind: usize,
  dice_limit: usize,
  dice_reroll_chances: usize,
  hand_card_limit: usize,
  max_cards_per_kind: usize,
  round_limit: usize,
  summons_limit: usize,
  supports_limit: usize,
  swap_cost: AbstractDices,
  swap_speed: EventSpeed,
}

impl Default for Mode {
  fn default() -> Self {
    Self {
      card_redraw_chances: CARD_REDRAW_CHANCES,
      deck_cards_requirement: DECK_CARDS_REQUIREMENT,
      deck_card_limit_per_kind: DECK_CARD_LIMIT_PER_KIND,
      deck_chars_requirement: DECK_CHARS_REQUIREMENT,
      deck_char_limit_per_kind: DECK_CHAR_LIMIT_PER_KIND,
      dice_limit: DICE_LIMIT,
      dice_reroll_chances: DICE_REROLL_CHANCES,
      hand_card_limit: HAND_CARD_LIMIT,
      max_cards_per_kind: MAX_CARDS_PER_KIND,
      round_limit: ROUND_LIMIT,
      summons_limit: SUMMONS_LIMIT,
      supports_limit: SUPPORTS_LIMIT,
      swap_cost: SWAP_COST.clone(),
      swap_speed: SWAP_SPEED,
    }
  }
}