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

#include <game.h>

Public Member Functions

 Game ()
 
 ~Game ()
 
void Clear ()
 
void ClearMoves ()
 
void Init ()
 
void SetNumHalfMoves (ushort x)
 
ushort GetNumHalfMoves ()
 
ushort GetCurrentPly ()
 
void SetNextGame (Game *g)
 
GameGetNextGame ()
 
void SetAltered (bool b)
 
bool GetAltered (void)
 
bool HasNonStandardStart ()
 
bool HasPromotions ()
 
bool HasUnderPromotions ()
 
void SetStartPos (Position *pos)
 
errorT SetStartFen (const char *fenStr)
 
void SetScidFlags (const char *s)
 
PositionGetStartPos ()
 
PositionGetCurrentPos ()
 
simpleMoveTGetCurrentMove ()
 
void InitMove (moveT *m)
 
void SaveState ()
 
errorT RestoreState ()
 
void SetMoveData (moveT *m, simpleMoveT *sm)
 
errorT AddMove (simpleMoveT *sm, char *san)
 
errorT AddVariation ()
 
errorT DeleteSubVariation (moveT *m)
 
errorT DeleteVariation (uint varNumber)
 
errorT DeleteVariationAndFree (uint varNumber)
 
errorT FirstVariation (uint varNumber)
 
errorT MainVariation ()
 
uint GetVarNumber ()
 
void SetMoveComment (const char *comment)
 
const char * GetMoveComment ()
 
const char * GetPreviousMoveComment ()
 Game::GetPreviousMoveComment() Return the comment on the move previously played by CurrentPos->ToMove If there are no previous moves, return an empty comment. More...
 
errorT AddNag (byte nag)
 
errorT RemoveNag (bool isMoveNag)
 
byteGetNags ()
 
byteGetNextNags ()
 
void ClearNags ()
 
void MoveTo (const std::vector< int > &v)
 
void MoveToPly (ushort hmNumber)
 
errorT MoveForward ()
 
errorT MoveBackup ()
 
errorT MoveIntoVariation (uint varNumber)
 
errorT MoveExitVariation ()
 
bool AtStart ()
 
bool AtEnd ()
 
bool AtVarStart ()
 
bool AtVarEnd ()
 
uint GetVarLevel ()
 
uint GetNumVariations ()
 
void Truncate ()
 
void TruncateAndFree ()
 
void TruncateStart ()
 
void SetEventStr (const char *str)
 
void SetSiteStr (const char *str)
 
void SetWhiteStr (const char *str)
 
void SetBlackStr (const char *str)
 
void SetRoundStr (const char *str)
 
void SetDate (dateT date)
 
void SetEventDate (dateT date)
 
void SetResult (resultT res)
 
void SetWhiteElo (eloT elo)
 
void SetBlackElo (eloT elo)
 
void SetWhiteEstimateElo (eloT elo)
 
void SetBlackEstimateElo (eloT elo)
 
void SetWhiteRatingType (byte b)
 
void SetBlackRatingType (byte b)
 
void SetEco (ecoT eco)
 
const char * GetEventStr ()
 
const char * GetSiteStr ()
 
const char * GetWhiteStr ()
 
const char * GetBlackStr ()
 
const char * GetRoundStr ()
 
dateT GetDate ()
 
dateT GetEventDate ()
 
resultT GetResult ()
 
eloT GetWhiteElo ()
 
eloT GetBlackElo ()
 
eloT GetWhiteEstimateElo ()
 
eloT GetBlackEstimateElo ()
 
byte GetWhiteRatingType ()
 
byte GetBlackRatingType ()
 
ecoT GetEco ()
 
eloT GetAverageElo ()
 
void AddPgnTag (const char *tag, const char *value)
 
bool RemoveExtraTag (const char *tag)
 
const char * FindExtraTag (const char *tag)
 
uint GetNumExtraTags ()
 
tagTGetExtraTags ()
 
void ClearExtraTags ()
 
void MakeHomePawnList (byte *pbPawnList)
 
compareT CompareCurrentPos (Position *p)
 
void CopyStandardTags (Game *fromGame)
 
errorT LoadStandardTags (const IndexEntry *ie, const NameBase *nb)
 
void ClearStandardTags ()
 
void GetSAN (char *str)
 
void GetPrevSAN (char *str)
 
void GetPrevMoveUCI (char *str)
 
void GetNextMoveUCI (char *str)
 
bool CommentEmpty (const char *comment)
 
void WriteComment (TextBuffer *tb, const char *preStr, const char *comment, const char *postStr)
 
errorT WriteMoveList (TextBuffer *tb, uint plyCount, moveT *oldCurrentMove, bool printMoveNum, bool inComment)
 
errorT WritePGN (TextBuffer *tb, uint stopLocation)
 
std::pair< const char *, unsigned > WriteToPGN (uint lineWidth=0, bool NewLineAtEnd=false, bool newLineToSpaces=true)
 
errorT MoveToLocationInPGN (uint stopLocation)
 
errorT WriteExtraTags (FILE *fp)
 
uint GetPgnOffset ()
 
void ResetPgnStyle (void)
 
void ResetPgnStyle (uint flag)
 
uint GetPgnStyle ()
 
void SetPgnStyle (uint mask, bool setting)
 
void AddPgnStyle (uint mask)
 
void RemovePgnStyle (uint mask)
 
void SetPgnFormat (gameFormatT gf)
 
bool SetPgnFormatFromString (const char *str)
 
bool IsPlainFormat ()
 
bool IsHtmlFormat ()
 
bool IsLatexFormat ()
 
bool IsColorFormat ()
 
void SetHtmlStyle (uint style)
 
uint GetHtmlStyle ()
 
errorT GetPartialMoveList (DString *str, uint plyCount)
 
bool MoveMatch (int m_argc, char **m_argv, uint plyCount, bool wToMove, bool bToMove, int checkTest)
 
errorT Encode (ByteBuffer *buf, IndexEntry *ie)
 
void EncodeTags (ByteBuffer *buf)
 
bool MaterialMatch (ByteBuffer *buf, byte *min, byte *max, patternT *pattern, int minPly, int maxPly, int matchLength, bool oppBishops, bool sameBishops, int minDiff, int maxDiff)
 
bool ExactMatch (Position *pos, ByteBuffer *buf, simpleMoveT *sm, gameExactMatchT searchType, bool *neverMatch)
 
bool VarExactMatch (Position *searchPos, gameExactMatchT searchType)
 
bool ExactMatch (Position *pos, ByteBuffer *buf, simpleMoveT *sm)
 
bool ExactMatch (Position *pos, ByteBuffer *buf, simpleMoveT *sm, bool *neverMatch)
 
bool ExactMatch (Position *pos, ByteBuffer *buf, simpleMoveT *sm, gameExactMatchT searchType)
 
errorT DecodeStart (ByteBuffer *buf)
 
errorT DecodeNextMove (ByteBuffer *buf, simpleMoveT *sm)
 
errorT Decode (ByteBuffer *buf, byte flags)
 
errorT DecodeTags (ByteBuffer *buf, bool storeTags)
 
std::vector< int > GetCurrentLocation ()
 
Gameclone ()
 

Static Public Member Functions

static bool PgnFormatFromString (const char *str, gameFormatT *fmt)
 

Detailed Description

Definition at line 227 of file game.h.

Constructor & Destructor Documentation

Game::Game ( )
inline

Definition at line 314 of file game.h.

Game::~Game ( )

Definition at line 72 of file game.cpp.

Member Function Documentation

errorT Game::AddMove ( simpleMoveT sm,
char *  san 
)

Definition at line 916 of file game.cpp.

errorT Game::AddNag ( byte  nag)
inline

Definition at line 572 of file game.h.

void Game::AddPgnStyle ( uint  mask)
inline

Definition at line 510 of file game.h.

void Game::AddPgnTag ( const char *  tag,
const char *  value 
)

Definition at line 697 of file game.cpp.

errorT Game::AddVariation ( )

Definition at line 958 of file game.cpp.

bool Game::AtEnd ( )
inline

Definition at line 408 of file game.h.

bool Game::AtStart ( )
inline

Definition at line 405 of file game.h.

bool Game::AtVarEnd ( )
inline

Definition at line 413 of file game.h.

bool Game::AtVarStart ( )
inline

Definition at line 411 of file game.h.

void Game::Clear ( )

Definition at line 585 of file game.cpp.

void Game::ClearExtraTags ( )

Definition at line 533 of file game.cpp.

void Game::ClearMoves ( )

Definition at line 545 of file game.cpp.

void Game::ClearNags ( )
inline

Definition at line 393 of file game.h.

void Game::ClearStandardTags ( )

Definition at line 513 of file game.cpp.

Game * Game::clone ( )

Definition at line 4022 of file game.cpp.

bool Game::CommentEmpty ( const char *  comment)

Definition at line 2034 of file game.cpp.

compareT Game::CompareCurrentPos ( Position p)
void Game::CopyStandardTags ( Game fromGame)

Definition at line 2902 of file game.cpp.

errorT Game::Decode ( ByteBuffer buf,
byte  flags 
)

Definition at line 3931 of file game.cpp.

errorT Game::DecodeNextMove ( ByteBuffer buf,
simpleMoveT sm 
)

Definition at line 3817 of file game.cpp.

errorT Game::DecodeStart ( ByteBuffer buf)

Definition at line 3885 of file game.cpp.

errorT Game::DecodeTags ( ByteBuffer buf,
bool  storeTags 
)

Definition at line 3565 of file game.cpp.

errorT Game::DeleteSubVariation ( moveT m)
errorT Game::DeleteVariation ( uint  varNumber)

Definition at line 1116 of file game.cpp.

errorT Game::DeleteVariationAndFree ( uint  varNumber)

Definition at line 1141 of file game.cpp.

errorT Game::Encode ( ByteBuffer buf,
IndexEntry ie 
)

Definition at line 3704 of file game.cpp.

void Game::EncodeTags ( ByteBuffer buf)
bool Game::ExactMatch ( Position pos,
ByteBuffer buf,
simpleMoveT sm,
gameExactMatchT  searchType,
bool *  neverMatch 
)

Definition at line 1531 of file game.cpp.

bool Game::ExactMatch ( Position pos,
ByteBuffer buf,
simpleMoveT sm 
)
inline

Definition at line 538 of file game.h.

bool Game::ExactMatch ( Position pos,
ByteBuffer buf,
simpleMoveT sm,
bool *  neverMatch 
)
inline

Definition at line 540 of file game.h.

bool Game::ExactMatch ( Position pos,
ByteBuffer buf,
simpleMoveT sm,
gameExactMatchT  searchType 
)
inline

Definition at line 543 of file game.h.

const char * Game::FindExtraTag ( const char *  tag)

Definition at line 722 of file game.cpp.

errorT Game::FirstVariation ( uint  varNumber)

Definition at line 1002 of file game.cpp.

bool Game::GetAltered ( void  )
inline

Definition at line 330 of file game.h.

eloT Game::GetAverageElo ( )

Definition at line 2955 of file game.cpp.

eloT Game::GetBlackElo ( )
inline

Definition at line 448 of file game.h.

eloT Game::GetBlackEstimateElo ( )
inline

Definition at line 450 of file game.h.

byte Game::GetBlackRatingType ( )
inline

Definition at line 452 of file game.h.

const char* Game::GetBlackStr ( )
inline

Definition at line 442 of file game.h.

std::vector< int > Game::GetCurrentLocation ( )

Definition at line 4001 of file game.cpp.

simpleMoveT* Game::GetCurrentMove ( )
inline

Definition at line 350 of file game.h.

ushort Game::GetCurrentPly ( )
inline

Definition at line 325 of file game.h.

Position* Game::GetCurrentPos ( )
inline

Definition at line 348 of file game.h.

dateT Game::GetDate ( )
inline

Definition at line 444 of file game.h.

ecoT Game::GetEco ( )
inline

Definition at line 453 of file game.h.

dateT Game::GetEventDate ( )
inline

Definition at line 445 of file game.h.

const char* Game::GetEventStr ( )
inline

Definition at line 439 of file game.h.

tagT* Game::GetExtraTags ( )
inline

Definition at line 461 of file game.h.

uint Game::GetHtmlStyle ( )
inline

Definition at line 522 of file game.h.

const char* Game::GetMoveComment ( )
inline

Definition at line 374 of file game.h.

byte* Game::GetNags ( )
inline

Definition at line 391 of file game.h.

Game* Game::GetNextGame ( )
inline

Definition at line 328 of file game.h.

void Game::GetNextMoveUCI ( char *  str)

Definition at line 2017 of file game.cpp.

byte* Game::GetNextNags ( )
inline

Definition at line 392 of file game.h.

uint Game::GetNumExtraTags ( )
inline

Definition at line 460 of file game.h.

ushort Game::GetNumHalfMoves ( )
inline

Definition at line 324 of file game.h.

uint Game::GetNumVariations ( )
inline

Definition at line 416 of file game.h.

errorT Game::GetPartialMoveList ( DString str,
uint  plyCount 
)

Definition at line 1854 of file game.cpp.

uint Game::GetPgnOffset ( )
inline

Definition at line 492 of file game.h.

uint Game::GetPgnStyle ( )
inline

Definition at line 506 of file game.h.

const char* Game::GetPreviousMoveComment ( )
inline

Game::GetPreviousMoveComment() Return the comment on the move previously played by CurrentPos->ToMove If there are no previous moves, return an empty comment.

Definition at line 380 of file game.h.

void Game::GetPrevMoveUCI ( char *  str)

Definition at line 1998 of file game.cpp.

void Game::GetPrevSAN ( char *  str)

Definition at line 1977 of file game.cpp.

resultT Game::GetResult ( )
inline

Definition at line 446 of file game.h.

const char* Game::GetRoundStr ( )
inline

Definition at line 443 of file game.h.

void Game::GetSAN ( char *  str)

Definition at line 1958 of file game.cpp.

const char* Game::GetSiteStr ( )
inline

Definition at line 440 of file game.h.

Position* Game::GetStartPos ( )
inline

Definition at line 347 of file game.h.

uint Game::GetVarLevel ( )
inline

Definition at line 415 of file game.h.

uint Game::GetVarNumber ( )

Definition at line 89 of file game.cpp.

eloT Game::GetWhiteElo ( )
inline

Definition at line 447 of file game.h.

eloT Game::GetWhiteEstimateElo ( )
inline

Definition at line 449 of file game.h.

byte Game::GetWhiteRatingType ( )
inline

Definition at line 451 of file game.h.

const char* Game::GetWhiteStr ( )
inline

Definition at line 441 of file game.h.

bool Game::HasNonStandardStart ( )
inline

Definition at line 332 of file game.h.

bool Game::HasPromotions ( )
inline

Definition at line 336 of file game.h.

bool Game::HasUnderPromotions ( )
inline

Definition at line 337 of file game.h.

void Game::Init ( )

Definition at line 495 of file game.cpp.

void Game::InitMove ( moveT m)
inline

Definition at line 558 of file game.h.

bool Game::IsColorFormat ( )
inline

Definition at line 519 of file game.h.

bool Game::IsHtmlFormat ( )
inline

Definition at line 517 of file game.h.

bool Game::IsLatexFormat ( )
inline

Definition at line 518 of file game.h.

bool Game::IsPlainFormat ( )
inline

Definition at line 516 of file game.h.

errorT Game::LoadStandardTags ( const IndexEntry ie,
const NameBase nb 
)

Definition at line 2932 of file game.cpp.

errorT Game::MainVariation ( )

Definition at line 1040 of file game.cpp.

void Game::MakeHomePawnList ( byte pbPawnList)

Definition at line 1253 of file game.cpp.

bool Game::MaterialMatch ( ByteBuffer buf,
byte min,
byte max,
patternT pattern,
int  minPly,
int  maxPly,
int  matchLength,
bool  oppBishops,
bool  sameBishops,
int  minDiff,
int  maxDiff 
)

Definition at line 1390 of file game.cpp.

errorT Game::MoveBackup ( void  )

Definition at line 813 of file game.cpp.

errorT Game::MoveExitVariation ( void  )

Definition at line 888 of file game.cpp.

errorT Game::MoveForward ( void  )

Definition at line 796 of file game.cpp.

errorT Game::MoveIntoVariation ( uint  varNumber)

Definition at line 863 of file game.cpp.

bool Game::MoveMatch ( int  m_argc,
char **  m_argv,
uint  plyCount,
bool  wToMove,
bool  bToMove,
int  checkTest 
)

Definition at line 1893 of file game.cpp.

void Game::MoveTo ( const std::vector< int > &  v)

Definition at line 845 of file game.cpp.

errorT Game::MoveToLocationInPGN ( uint  stopLocation)

Definition at line 2887 of file game.cpp.

void Game::MoveToPly ( ushort  hmNumber)

Definition at line 830 of file game.cpp.

bool Game::PgnFormatFromString ( const char *  str,
gameFormatT fmt 
)
static

Definition at line 615 of file game.cpp.

bool Game::RemoveExtraTag ( const char *  tag)

Definition at line 734 of file game.cpp.

errorT Game::RemoveNag ( bool  isMoveNag)
inline

Definition at line 607 of file game.h.

void Game::RemovePgnStyle ( uint  mask)
inline

Definition at line 511 of file game.h.

void Game::ResetPgnStyle ( void  )
inline

Definition at line 503 of file game.h.

void Game::ResetPgnStyle ( uint  flag)
inline

Definition at line 504 of file game.h.

errorT Game::RestoreState ( )

Definition at line 430 of file game.cpp.

void Game::SaveState ( )

Definition at line 416 of file game.cpp.

void Game::SetAltered ( bool  b)
inline

Definition at line 329 of file game.h.

void Game::SetBlackElo ( eloT  elo)
inline

Definition at line 433 of file game.h.

void Game::SetBlackEstimateElo ( eloT  elo)
inline

Definition at line 435 of file game.h.

void Game::SetBlackRatingType ( byte  b)
inline

Definition at line 437 of file game.h.

void Game::SetBlackStr ( const char *  str)
inline

Definition at line 427 of file game.h.

void Game::SetDate ( dateT  date)
inline

Definition at line 429 of file game.h.

void Game::SetEco ( ecoT  eco)
inline

Definition at line 438 of file game.h.

void Game::SetEventDate ( dateT  date)
inline

Definition at line 430 of file game.h.

void Game::SetEventStr ( const char *  str)
inline

Definition at line 424 of file game.h.

void Game::SetHtmlStyle ( uint  style)
inline

Definition at line 521 of file game.h.

void Game::SetMoveComment ( const char *  comment)

Definition at line 779 of file game.cpp.

void Game::SetMoveData ( moveT m,
simpleMoveT sm 
)
inline

Definition at line 757 of file game.cpp.

void Game::SetNextGame ( Game g)
inline

Definition at line 327 of file game.h.

void Game::SetNumHalfMoves ( ushort  x)
inline

Definition at line 323 of file game.h.

void Game::SetPgnFormat ( gameFormatT  gf)
inline

Definition at line 513 of file game.h.

bool Game::SetPgnFormatFromString ( const char *  str)

Definition at line 638 of file game.cpp.

void Game::SetPgnStyle ( uint  mask,
bool  setting 
)
inline

Definition at line 507 of file game.h.

void Game::SetResult ( resultT  res)
inline

Definition at line 431 of file game.h.

void Game::SetRoundStr ( const char *  str)
inline

Definition at line 428 of file game.h.

void Game::SetScidFlags ( const char *  s)
inline

Definition at line 342 of file game.h.

void Game::SetSiteStr ( const char *  str)
inline

Definition at line 425 of file game.h.

errorT Game::SetStartFen ( const char *  fenStr)

Definition at line 671 of file game.cpp.

void Game::SetStartPos ( Position pos)

Definition at line 648 of file game.cpp.

void Game::SetWhiteElo ( eloT  elo)
inline

Definition at line 432 of file game.h.

void Game::SetWhiteEstimateElo ( eloT  elo)
inline

Definition at line 434 of file game.h.

void Game::SetWhiteRatingType ( byte  b)
inline

Definition at line 436 of file game.h.

void Game::SetWhiteStr ( const char *  str)
inline

Definition at line 426 of file game.h.

void Game::Truncate ( void  )

Definition at line 1180 of file game.cpp.

void Game::TruncateAndFree ( void  )

Definition at line 1193 of file game.cpp.

void Game::TruncateStart ( void  )

Definition at line 1218 of file game.cpp.

bool Game::VarExactMatch ( Position searchPos,
gameExactMatchT  searchType 
)

Definition at line 1761 of file game.cpp.

void Game::WriteComment ( TextBuffer tb,
const char *  preStr,
const char *  comment,
const char *  postStr 
)

Definition at line 2068 of file game.cpp.

errorT Game::WriteExtraTags ( FILE *  fp)

Definition at line 2969 of file game.cpp.

errorT Game::WriteMoveList ( TextBuffer tb,
uint  plyCount,
moveT oldCurrentMove,
bool  printMoveNum,
bool  inComment 
)

Definition at line 2118 of file game.cpp.

errorT Game::WritePGN ( TextBuffer tb,
uint  stopLocation 
)

Definition at line 2606 of file game.cpp.

std::pair< const char *, unsigned > Game::WriteToPGN ( uint  lineWidth = 0,
bool  NewLineAtEnd = false,
bool  newLineToSpaces = true 
)

Definition at line 2874 of file game.cpp.


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