Struct fen4::Extra [−][src]
pub struct Extra { pub royal: [Option<Position>; 4], pub lives: Option<[usize; 4]>, pub resigned: [bool; 4], pub flagged: [bool; 4], pub stalemated: [bool; 4], pub game_over: String, pub zombie_immune: [bool; 4], pub zombie_type: [String; 4], pub enpassant: [Option<(Position, Position)>; 4], pub pawnbaserank: usize, pub uniquify: usize, pub std2pc: bool, }
Expand description
Additional options in the FEN4 format stored as a list of key value pairs.
In addition to the always present options in a FEN4, there are also options that are only present if rule variants are enabled. Notable examples would be “en passant” (because its not considered standard) and “N-Check”
The format uses a series of labeled elements separated by commas. The highlevel
structure looks like {'label':value,'label2':value2}
.
Values seem to be able to take several types. But the ones that are confirmed are:
- Strings
'string_value'
- Numbers
65900
- Booleans
true
andfalse
- Arrays
(valueRed, valueBlue, valueYellow, valueGreen)
Examples of known labels used are:
'enPassant':('j3:j4','','','')
- The first position is where a pawn can capture and the second is where the passing pawn should be removed in the event of a capture.
- This is neccessary notation because some types of fairy pawns move diagonally. Without the extra information it could be ambiguous.
'lives':(9,6,4,0)
- Indicates number of lives left for the N-check variant
'pawnsBaseRank':8
- The rank on which pawns can jump forward 2 square (default:2)
- a value of
0
indicates pawns never move more than 1
'royal':('a4','b5','c6','d7')
- Used to indicate which piece should be considered the king for purposes of checks
- Neccessary in cases of multiple kings (of the same color) or for making a different piece act as the leader
- This seems to have previously been called ‘kingSquares’
'uniquify':94403
- It is not clear what this actually does
'resigned':(true,true,false,false)
and'flagged':(false,true,false,false)
- Both seem to be neccesssary for the “DeadKingWalking” feature.
'stalemated':(true,true,false,false)
- It is not clear this has any effect, but it might affect the “DeadKingWalking” feature.
'zombieImmune':(true,false,false,true)
- Makes zombie pieces impossible to capture
'zombieType':('','','','muncher')
- Used to change the behaviour of zombies
- Possible types include muncher, comfuter, checker, ranter, and possibly more
The labels have a preferred order. The preferred order is the order of the fields of the struct.
gameOver is an additional option, but only seems to appear in internal messages. It would fit somwhere between flagged and enPassant in terms of preferred order and stores the message that shows up at the end of the game.
This will also use gameOver to represent final messages, but will not specifically try to be compatable with chess.com’s internal messages.
Fields
royal: [Option<Position>; 4]
lives: Option<[usize; 4]>
resigned: [bool; 4]
flagged: [bool; 4]
stalemated: [bool; 4]
game_over: String
zombie_immune: [bool; 4]
zombie_type: [String; 4]
enpassant: [Option<(Position, Position)>; 4]
pawnbaserank: usize
uniquify: usize
std2pc: bool
Trait Implementations
impl Eq for Extra
[src]
impl StructuralEq for Extra
[src]
impl StructuralPartialEq for Extra
[src]
Auto Trait Implementations
impl RefUnwindSafe for Extra
impl Send for Extra
impl Sync for Extra
impl Unpin for Extra
impl UnwindSafe for Extra
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more