pub struct Variant {Show 16 fields
pub red_teammate: Color,
pub initial_board: Board,
pub king_of_the_hill: bool,
pub antichess: bool,
pub promote_to: Vec<char>,
pub dead_wall: bool,
pub en_passant: bool,
pub capture_the_king: bool,
pub pawn_promotion_rank: usize,
pub ncheck: usize,
pub chess960: u16,
pub ffa_dead_king_walking: bool,
pub ffa_takeover: bool,
pub ffa_opp_x: u16,
pub ffa_points_for_mate: u16,
pub ffa_play_for_mate: bool,
}
Expand description
Representation of different variants of 4 player chess
This has been made to closely resemble the setup for starting games on Chess.com.
Fields§
§red_teammate: Color
§initial_board: Board
§king_of_the_hill: bool
§antichess: bool
§promote_to: Vec<char>
§dead_wall: bool
§en_passant: bool
§capture_the_king: bool
§pawn_promotion_rank: usize
§ncheck: usize
§chess960: u16
§ffa_dead_king_walking: bool
§ffa_takeover: bool
§ffa_opp_x: u16
§ffa_points_for_mate: u16
§ffa_play_for_mate: bool
Implementations§
Source§impl Variant
impl Variant
Sourcepub fn team_default() -> Self
pub fn team_default() -> Self
The default variant for the team gamemode.
Sourcepub fn ffa_default() -> Self
pub fn ffa_default() -> Self
The default for the ffa and solo gamemodes
Sourcepub fn fairy(&self) -> bool
pub fn fairy(&self) -> bool
Returns true if there are any non-standard pieces in play (or could promote to such a piece)
Sourcepub fn pawn_base_rank(&self) -> usize
pub fn pawn_base_rank(&self) -> usize
Distance of the pans base rank from the edge of the board.
Trait Implementations§
impl Eq for Variant
impl StructuralPartialEq for Variant
Auto Trait Implementations§
impl Freeze for Variant
impl RefUnwindSafe for Variant
impl Send for Variant
impl Sync for Variant
impl Unpin for Variant
impl UnwindSafe for Variant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more