use crate::{
core::{Move, Piece},
errors::{FenError, MoveError, PGNError},
logic::Game,
};
use super::{Color, GameStatus, Position};
pub trait Variant {
fn move_piece(&mut self, move_str: &str) -> Result<GameStatus, MoveError>;
fn undo(&mut self);
fn redo(&mut self);
fn pgn(&self) -> String;
fn fen(&self) -> String;
fn get_piece_at(&self, pos: Position) -> Option<Piece>;
fn get_legal_moves(&self, pos: Position) -> Vec<Move>;
fn save(&self, path: &str, overwrite: bool) -> Result<(), std::io::Error>;
fn resign(&mut self, color: Color);
fn draw(&mut self);
fn lost_on_time(&mut self, color: Color);
fn get_minified_fen(&self) -> String;
fn get_last_move(&self) -> Option<Move>;
fn is_white_turn(&self) -> bool;
fn get_halfmove_clock(&self) -> u32;
fn get_fullmove_number(&self) -> u32;
fn get_castling_rights(&self) -> String;
fn get_en_passant(&self) -> Option<Position>;
fn get_starting_fen(&self) -> String;
fn get_status(&self) -> GameStatus;
}
pub trait VariantBuilder: Sized + Default {
fn name() -> &'static str;
fn new(game: Game) -> Self;
fn from_fen(fen: &str) -> Result<Self, FenError>;
fn from_pgn(pgn: &str) -> Result<Self, PGNError>;
fn load(path: &str) -> Result<Self, PGNError>;
fn load_all(path: &str) -> Result<Vec<Self>, PGNError>;
}