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 ( )

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)

Definition at line 572 of file game.h.

void Game::AddPgnStyle ( uint  mask)

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 ( )

Definition at line 408 of file game.h.

bool Game::AtStart ( )

Definition at line 405 of file game.h.

bool Game::AtVarEnd ( )

Definition at line 413 of file game.h.

bool Game::AtVarStart ( )

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 ( )

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 

Definition at line 538 of file game.h.

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

Definition at line 540 of file game.h.

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

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  )

Definition at line 330 of file game.h.

eloT Game::GetAverageElo ( )

Definition at line 2955 of file game.cpp.

eloT Game::GetBlackElo ( )

Definition at line 448 of file game.h.

eloT Game::GetBlackEstimateElo ( )

Definition at line 450 of file game.h.

byte Game::GetBlackRatingType ( )

Definition at line 452 of file game.h.

const char* Game::GetBlackStr ( )

Definition at line 442 of file game.h.

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

Definition at line 4001 of file game.cpp.

simpleMoveT* Game::GetCurrentMove ( )

Definition at line 350 of file game.h.

ushort Game::GetCurrentPly ( )

Definition at line 325 of file game.h.

Position* Game::GetCurrentPos ( )

Definition at line 348 of file game.h.

dateT Game::GetDate ( )

Definition at line 444 of file game.h.

ecoT Game::GetEco ( )

Definition at line 453 of file game.h.

dateT Game::GetEventDate ( )

Definition at line 445 of file game.h.

const char* Game::GetEventStr ( )

Definition at line 439 of file game.h.

tagT* Game::GetExtraTags ( )

Definition at line 461 of file game.h.

uint Game::GetHtmlStyle ( )

Definition at line 522 of file game.h.

const char* Game::GetMoveComment ( )

Definition at line 374 of file game.h.

byte* Game::GetNags ( )

Definition at line 391 of file game.h.

Game* Game::GetNextGame ( )

Definition at line 328 of file game.h.

void Game::GetNextMoveUCI ( char *  str)

Definition at line 2017 of file game.cpp.

byte* Game::GetNextNags ( )

Definition at line 392 of file game.h.

uint Game::GetNumExtraTags ( )

Definition at line 460 of file game.h.

ushort Game::GetNumHalfMoves ( )

Definition at line 324 of file game.h.

uint Game::GetNumVariations ( )

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 ( )

Definition at line 492 of file game.h.

uint Game::GetPgnStyle ( )

Definition at line 506 of file game.h.

const char* Game::GetPreviousMoveComment ( )

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 ( )

Definition at line 446 of file game.h.

const char* Game::GetRoundStr ( )

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 ( )

Definition at line 440 of file game.h.

Position* Game::GetStartPos ( )

Definition at line 347 of file game.h.

uint Game::GetVarLevel ( )

Definition at line 415 of file game.h.

uint Game::GetVarNumber ( )

Definition at line 89 of file game.cpp.

eloT Game::GetWhiteElo ( )

Definition at line 447 of file game.h.

eloT Game::GetWhiteEstimateElo ( )

Definition at line 449 of file game.h.

byte Game::GetWhiteRatingType ( )

Definition at line 451 of file game.h.

const char* Game::GetWhiteStr ( )

Definition at line 441 of file game.h.

bool Game::HasNonStandardStart ( )

Definition at line 332 of file game.h.

bool Game::HasPromotions ( )

Definition at line 336 of file game.h.

bool Game::HasUnderPromotions ( )

Definition at line 337 of file game.h.

void Game::Init ( )

Definition at line 495 of file game.cpp.

void Game::InitMove ( moveT m)

Definition at line 558 of file game.h.

bool Game::IsColorFormat ( )

Definition at line 519 of file game.h.

bool Game::IsHtmlFormat ( )

Definition at line 517 of file game.h.

bool Game::IsLatexFormat ( )

Definition at line 518 of file game.h.

bool Game::IsPlainFormat ( )

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 

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)

Definition at line 607 of file game.h.

void Game::RemovePgnStyle ( uint  mask)

Definition at line 511 of file game.h.

void Game::ResetPgnStyle ( void  )

Definition at line 503 of file game.h.

void Game::ResetPgnStyle ( uint  flag)

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)

Definition at line 329 of file game.h.

void Game::SetBlackElo ( eloT  elo)

Definition at line 433 of file game.h.

void Game::SetBlackEstimateElo ( eloT  elo)

Definition at line 435 of file game.h.

void Game::SetBlackRatingType ( byte  b)

Definition at line 437 of file game.h.

void Game::SetBlackStr ( const char *  str)

Definition at line 427 of file game.h.

void Game::SetDate ( dateT  date)

Definition at line 429 of file game.h.

void Game::SetEco ( ecoT  eco)

Definition at line 438 of file game.h.

void Game::SetEventDate ( dateT  date)

Definition at line 430 of file game.h.

void Game::SetEventStr ( const char *  str)

Definition at line 424 of file game.h.

void Game::SetHtmlStyle ( uint  style)

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 

Definition at line 757 of file game.cpp.

void Game::SetNextGame ( Game g)

Definition at line 327 of file game.h.

void Game::SetNumHalfMoves ( ushort  x)

Definition at line 323 of file game.h.

void Game::SetPgnFormat ( gameFormatT  gf)

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 

Definition at line 507 of file game.h.

void Game::SetResult ( resultT  res)

Definition at line 431 of file game.h.

void Game::SetRoundStr ( const char *  str)

Definition at line 428 of file game.h.

void Game::SetScidFlags ( const char *  s)

Definition at line 342 of file game.h.

void Game::SetSiteStr ( const char *  str)

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)

Definition at line 432 of file game.h.

void Game::SetWhiteEstimateElo ( eloT  elo)

Definition at line 434 of file game.h.

void Game::SetWhiteRatingType ( byte  b)

Definition at line 436 of file game.h.

void Game::SetWhiteStr ( const char *  str)

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: