Scid  4.6.5
Public Member Functions | Static Public Member Functions | List of all members
Position Class Reference

#include <position.h>

Public Member Functions

 Position ()
 
void Clear ()
 
void StdStart ()
 
bool IsStdStart ()
 
errorT AddPiece (pieceT p, squareT sq)
 
byte PieceCount (pieceT p)
 
byteGetMaterial ()
 
void SetEPTarget (squareT s)
 
squareT GetEPTarget ()
 
void SetToMove (colorT c)
 
colorT GetToMove ()
 
void SetPlyCounter (ushort x)
 
ushort GetPlyCounter ()
 
ushort GetFullMoveCount ()
 
squareTGetList (colorT c)
 
uint GetCount (colorT c)
 
uint TotalMaterial ()
 
uint NumNonPawns (colorT c)
 
bool InPawnEnding ()
 
uint MaterialValue (colorT c)
 
uint FyleCount (pieceT p, fyleT f)
 
uint RankCount (pieceT p, rankT r)
 
uint LeftDiagCount (pieceT p, leftDiagT diag)
 
uint RightDiagCount (pieceT p, rightDiagT diag)
 
uint SquareColorCount (pieceT p, colorT sqColor)
 
uint GetSquares (pieceT p, SquareList *sqlist)
 
const pieceTGetBoard () const
 
squareT GetKingSquare (colorT c)
 
squareT GetKingSquare ()
 
squareT GetEnemyKingSquare ()
 
void SetCastling (colorT c, castleDirT dir, bool flag)
 
bool GetCastling (colorT c, castleDirT dir)
 
bool CastlingPossible ()
 
byte GetCastlingFlags ()
 
void SetCastlingFlags (byte b)
 
void SetStrictCastling (bool b)
 
bool GetStrictCastling (void)
 
uint HashValue (void)
 
uint PawnHashValue (void)
 
uint GetHPSig ()
 
void CalcPins ()
 
void GenPieceMoves (MoveList *mlist, squareT sq, SquareSet *sqset, bool capturesOnly)
 
void GenerateMoves (MoveList *mlist, pieceT mask, genMovesT genType, bool maybeInCheck)
 
void GenerateMoves (MoveList *mlist)
 
void GenerateMoves (MoveList *mlist, genMovesT genType)
 
void GenerateCaptures (MoveList *mlist)
 
bool IsLegalMove (simpleMoveT *sm)
 
void GenCheckEvasions (MoveList *mlist, pieceT mask, genMovesT genType, SquareList *checkSquares)
 
void MatchLegalMove (MoveList *mlist, pieceT mask, squareT target)
 
errorT MatchPawnMove (MoveList *mlist, fyleT fromFyle, squareT to, pieceT promote)
 
errorT MatchKingMove (MoveList *mlist, squareT target)
 
uint CalcAttacks (colorT toMove, squareT kingSq, SquareList *squares)
 
int TreeCalcAttacks (colorT toMove, squareT target)
 
uint CalcNumChecks ()
 
uint CalcNumChecks (squareT kingSq)
 
uint CalcNumChecks (squareT kingSq, SquareList *checkSquares)
 
uint Mobility (pieceT p, colorT color, squareT from)
 
bool IsKingInCheck ()
 
bool IsKingInCheckDir (directionT dir)
 
bool IsKingInCheck (simpleMoveT *sm)
 
bool IsKingInMate ()
 
bool IsLegal ()
 
bool IsPromoMove (squareT from, squareT to)
 
void DoSimpleMove (simpleMoveT *sm)
 
void UndoSimpleMove (simpleMoveT *sm)
 
errorT RelocatePiece (squareT fromSq, squareT toSq)
 
void MakeSANString (simpleMoveT *sm, char *s, sanFlagT flag)
 
void MakeUCIString (simpleMoveT *sm, char *s)
 
void CalcSANStrings (sanListT *sanList, sanFlagT flag)
 
errorT ReadCoordMove (simpleMoveT *m, const char *s, bool reverse)
 
errorT ReadMove (simpleMoveT *m, const char *s, tokenT t)
 
errorT ParseMove (simpleMoveT *sm, const char *s)
 
errorT ReadLine (const char *s)
 
void MakeLongStr (char *str)
 
void DumpBoard (FILE *fp)
 
void DumpLists (FILE *fp)
 
errorT ReadFromLongStr (const char *str)
 
errorT ReadFromCompactStr (const byte *str)
 
errorT ReadFromFEN (const char *s)
 
void PrintCompactStr (char *cboard)
 
void PrintCompactStrFlipped (char *cboard)
 
byte CompactStrFirstByte ()
 
void PrintFEN (char *str, uint flags)
 
void DumpLatexBoard (DString *dstr, bool flip)
 
void DumpLatexBoard (DString *dstr)
 
void DumpHtmlBoard (DString *dstr, uint style, const char *dir, bool flip)
 
void DumpHtmlBoard (DString *dstr, uint style, const char *dir)
 
int Compare (Position *p)
 
void CopyFrom (Position *src)
 
errorT Random (const char *material)
 

Static Public Member Functions

static const PositiongetStdStart ()
 

Detailed Description

Definition at line 75 of file position.h.

Constructor & Destructor Documentation

Position::Position ( )

Definition at line 547 of file position.cpp.

Member Function Documentation

errorT Position::AddPiece ( pieceT  p,
squareT  sq 
)

Definition at line 673 of file position.cpp.

uint Position::CalcAttacks ( colorT  toMove,
squareT  kingSq,
SquareList squares 
)

Definition at line 1409 of file position.cpp.

uint Position::CalcNumChecks ( )
inline

Definition at line 233 of file position.h.

uint Position::CalcNumChecks ( squareT  kingSq)
inline

Definition at line 236 of file position.h.

uint Position::CalcNumChecks ( squareT  kingSq,
SquareList checkSquares 
)
inline

Definition at line 239 of file position.h.

void Position::CalcPins ( void  )

Definition at line 714 of file position.cpp.

void Position::CalcSANStrings ( sanListT sanList,
sanFlagT  flag 
)

Definition at line 2606 of file position.cpp.

bool Position::CastlingPossible ( )
inline

Definition at line 202 of file position.h.

void Position::Clear ( void  )

Definition at line 564 of file position.cpp.

byte Position::CompactStrFirstByte ( )
inline

Definition at line 275 of file position.h.

sint Position::Compare ( Position p)

Definition at line 3154 of file position.cpp.

void Position::CopyFrom ( Position src)
inline

Definition at line 291 of file position.h.

void Position::DoSimpleMove ( simpleMoveT sm)

Definition at line 1789 of file position.cpp.

void Position::DumpBoard ( FILE *  fp)

Definition at line 2675 of file position.cpp.

void Position::DumpHtmlBoard ( DString dstr,
uint  style,
const char *  dir,
bool  flip 
)

Definition at line 3051 of file position.cpp.

void Position::DumpHtmlBoard ( DString dstr,
uint  style,
const char *  dir 
)
inline

Definition at line 285 of file position.h.

void Position::DumpLatexBoard ( DString dstr,
bool  flip 
)

Definition at line 3127 of file position.cpp.

void Position::DumpLatexBoard ( DString dstr)
inline

Definition at line 280 of file position.h.

void Position::DumpLists ( FILE *  fp)

Definition at line 2695 of file position.cpp.

uint Position::FyleCount ( pieceT  p,
fyleT  f 
)
inline

Definition at line 172 of file position.h.

void Position::GenCheckEvasions ( MoveList mlist,
pieceT  mask,
genMovesT  genType,
SquareList checkSquares 
)

Definition at line 1293 of file position.cpp.

void Position::GenerateCaptures ( MoveList mlist)
inline

Definition at line 223 of file position.h.

void Position::GenerateMoves ( MoveList mlist,
pieceT  mask,
genMovesT  genType,
bool  maybeInCheck 
)

Definition at line 787 of file position.cpp.

void Position::GenerateMoves ( MoveList mlist)
inline

Definition at line 221 of file position.h.

void Position::GenerateMoves ( MoveList mlist,
genMovesT  genType 
)
inline

Definition at line 222 of file position.h.

void Position::GenPieceMoves ( MoveList mlist,
squareT  sq,
SquareSet sqset,
bool  capturesOnly 
)

Definition at line 755 of file position.cpp.

const pieceT* Position::GetBoard ( ) const
inline

Definition at line 189 of file position.h.

bool Position::GetCastling ( colorT  c,
castleDirT  dir 
)
inline

Definition at line 322 of file position.h.

byte Position::GetCastlingFlags ( )
inline

Definition at line 203 of file position.h.

uint Position::GetCount ( colorT  c)
inline

Definition at line 163 of file position.h.

squareT Position::GetEnemyKingSquare ( )
inline

Definition at line 197 of file position.h.

squareT Position::GetEPTarget ( )
inline

Definition at line 153 of file position.h.

ushort Position::GetFullMoveCount ( )
inline

Definition at line 158 of file position.h.

uint Position::GetHPSig ( void  )

Definition at line 523 of file position.cpp.

squareT Position::GetKingSquare ( colorT  c)
inline

Definition at line 195 of file position.h.

squareT Position::GetKingSquare ( )
inline

Definition at line 196 of file position.h.

squareT* Position::GetList ( colorT  c)
inline

Definition at line 162 of file position.h.

byte* Position::GetMaterial ( )
inline

Definition at line 151 of file position.h.

ushort Position::GetPlyCounter ( )
inline

Definition at line 157 of file position.h.

uint Position::GetSquares ( pieceT  p,
SquareList sqlist 
)

Definition at line 3173 of file position.cpp.

const Position & Position::getStdStart ( )
static

Definition at line 595 of file position.cpp.

bool Position::GetStrictCastling ( void  )
inline

Definition at line 207 of file position.h.

colorT Position::GetToMove ( )
inline

Definition at line 155 of file position.h.

uint Position::HashValue ( void  )
inline

Definition at line 210 of file position.h.

bool Position::InPawnEnding ( )
inline

Definition at line 168 of file position.h.

bool Position::IsKingInCheck ( )
inline

Definition at line 244 of file position.h.

bool Position::IsKingInCheck ( simpleMoveT sm)

Definition at line 1627 of file position.cpp.

bool Position::IsKingInCheckDir ( directionT  dir)

Definition at line 1556 of file position.cpp.

bool Position::IsKingInMate ( void  )

Definition at line 1724 of file position.cpp.

bool Position::IsLegal ( void  )

Definition at line 1744 of file position.cpp.

bool Position::IsLegalMove ( simpleMoveT sm)

Definition at line 877 of file position.cpp.

bool Position::IsPromoMove ( squareT  from,
squareT  to 
)

Definition at line 1766 of file position.cpp.

bool Position::IsStdStart ( )

Definition at line 652 of file position.cpp.

uint Position::LeftDiagCount ( pieceT  p,
leftDiagT  diag 
)
inline

Definition at line 178 of file position.h.

void Position::MakeLongStr ( char *  str)

Definition at line 2658 of file position.cpp.

void Position::MakeSANString ( simpleMoveT sm,
char *  s,
sanFlagT  flag 
)

Definition at line 2114 of file position.cpp.

void Position::MakeUCIString ( simpleMoveT sm,
char *  s 
)

Definition at line 2225 of file position.cpp.

errorT Position::MatchKingMove ( MoveList mlist,
squareT  target 
)

Definition at line 1208 of file position.cpp.

void Position::MatchLegalMove ( MoveList mlist,
pieceT  mask,
squareT  target 
)

Definition at line 970 of file position.cpp.

errorT Position::MatchPawnMove ( MoveList mlist,
fyleT  fromFyle,
squareT  to,
pieceT  promote 
)

Definition at line 1089 of file position.cpp.

uint Position::MaterialValue ( colorT  c)

Definition at line 2086 of file position.cpp.

uint Position::Mobility ( pieceT  p,
colorT  color,
squareT  from 
)

Definition at line 1688 of file position.cpp.

uint Position::NumNonPawns ( colorT  c)
inline

Definition at line 165 of file position.h.

errorT Position::ParseMove ( simpleMoveT sm,
const char *  s 
)

Definition at line 2492 of file position.cpp.

uint Position::PawnHashValue ( void  )
inline

Definition at line 211 of file position.h.

byte Position::PieceCount ( pieceT  p)
inline

Definition at line 150 of file position.h.

void Position::PrintCompactStr ( char *  cboard)

Definition at line 2752 of file position.cpp.

void Position::PrintCompactStrFlipped ( char *  cboard)

Definition at line 2781 of file position.cpp.

void Position::PrintFEN ( char *  str,
uint  flags 
)

Definition at line 2975 of file position.cpp.

errorT Position::Random ( const char *  material)

Definition at line 3197 of file position.cpp.

uint Position::RankCount ( pieceT  p,
rankT  r 
)
inline

Definition at line 175 of file position.h.

errorT Position::ReadCoordMove ( simpleMoveT m,
const char *  s,
bool  reverse 
)

Definition at line 2269 of file position.cpp.

errorT Position::ReadFromCompactStr ( const byte str)

Definition at line 2724 of file position.cpp.

errorT Position::ReadFromFEN ( const char *  s)

Definition at line 2812 of file position.cpp.

errorT Position::ReadFromLongStr ( const char *  str)

Definition at line 2618 of file position.cpp.

errorT Position::ReadLine ( const char *  s)

Definition at line 2556 of file position.cpp.

errorT Position::ReadMove ( simpleMoveT m,
const char *  s,
tokenT  t 
)

Definition at line 2317 of file position.cpp.

errorT Position::RelocatePiece ( squareT  fromSq,
squareT  toSq 
)

Definition at line 2031 of file position.cpp.

uint Position::RightDiagCount ( pieceT  p,
rightDiagT  diag 
)
inline

Definition at line 181 of file position.h.

void Position::SetCastling ( colorT  c,
castleDirT  dir,
bool  flag 
)
inline

Definition at line 308 of file position.h.

void Position::SetCastlingFlags ( byte  b)
inline

Definition at line 204 of file position.h.

void Position::SetEPTarget ( squareT  s)
inline

Definition at line 152 of file position.h.

void Position::SetPlyCounter ( ushort  x)
inline

Definition at line 156 of file position.h.

void Position::SetStrictCastling ( bool  b)
inline

Definition at line 206 of file position.h.

void Position::SetToMove ( colorT  c)
inline

Definition at line 154 of file position.h.

uint Position::SquareColorCount ( pieceT  p,
colorT  sqColor 
)
inline

Definition at line 184 of file position.h.

void Position::StdStart ( )
inline

Definition at line 145 of file position.h.

uint Position::TotalMaterial ( )
inline

Definition at line 164 of file position.h.

int Position::TreeCalcAttacks ( colorT  toMove,
squareT  target 
)

Definition at line 1372 of file position.cpp.

void Position::UndoSimpleMove ( simpleMoveT sm)

Definition at line 1940 of file position.cpp.


The documentation for this class was generated from the following files: