Scid  4.7.0
Classes | Namespaces | Macros | Enumerations | Functions | Variables
game.h File Reference
#include "common.h"
#include "date.h"
#include "indexentry.h"
#include "matsig.h"
#include "movetree.h"
#include "namebase.h"
#include "position.h"
#include <forward_list>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for game.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  patternT
 
class  Game
 
struct  gamepos::GamePos
 

Namespaces

 gamevisit
 
 gamepos
 

Macros

#define GAME_DECODE_NONE   0
 
#define GAME_DECODE_TAGS   1
 
#define GAME_DECODE_COMMENTS   2
 
#define GAME_DECODE_ALL   3
 
#define PGN_STYLE_TAGS   1
 
#define PGN_STYLE_COMMENTS   2
 
#define PGN_STYLE_VARS   4
 
#define PGN_STYLE_INDENT_COMMENTS   8
 
#define PGN_STYLE_INDENT_VARS   16
 
#define PGN_STYLE_SYMBOLS   32
 
#define PGN_STYLE_SHORT_HEADER   64
 
#define PGN_STYLE_MOVENUM_SPACE   128
 
#define PGN_STYLE_COLUMN   256
 
#define PGN_STYLE_SCIDFLAGS   512
 
#define PGN_STYLE_STRIP_MARKS   1024
 
#define PGN_STYLE_NO_NULL_MOVES   2048
 
#define PGN_STYLE_UNICODE   4096
 

Enumerations

enum  gameExactMatchT { GAME_EXACT_MATCH_Exact = 0, GAME_EXACT_MATCH_Pawns, GAME_EXACT_MATCH_Fyles, GAME_EXACT_MATCH_Material }
 
enum  gameFormatT { PGN_FORMAT_Plain = 0, PGN_FORMAT_HTML = 1, PGN_FORMAT_LaTeX = 2, PGN_FORMAT_Color = 3 }
 

Functions

void transPieces (char *s)
 
char transPiecesChar (char c)
 
void game_printNag (byte nag, char *str, bool asSymbol, gameFormatT format)
 
byte game_parseNag (std::pair< const char *, const char *> strview)
 
uint strGetRatingType (const char *name)
 
template<typename TFunc >
void gamevisit::tags_STR (const Game &game, TFunc visitor)
 
template<typename TFunc >
void gamevisit::tags_extra (const Game &game, TFunc visitor)
 
template<typename TCont >
void gamepos::collectPositions (Game &game, TCont &dest)
 Iterate all the positions of a game and store the corresponding GamePos objects into a container. More...
 
std::vector< GamePos > gamepos::collectPositions (Game &game)
 Returns all the positions of a game. More...
 

Variables

int language
 
const char * langPieces []
 
const byte NAG_GoodMove = 1
 
const byte NAG_PoorMove = 2
 
const byte NAG_ExcellentMove = 3
 
const byte NAG_Blunder = 4
 
const byte NAG_InterestingMove = 5
 
const byte NAG_DubiousMove = 6
 
const byte NAG_OnlyMove = 8
 
const byte NAG_Equal = 10
 
const byte NAG_Unclear = 13
 
const byte NAG_WhiteSlight = 14
 
const byte NAG_BlackSlight = 15
 
const byte NAG_WhiteClear = 16
 
const byte NAG_BlackClear = 17
 
const byte NAG_WhiteDecisive = 18
 
const byte NAG_BlackDecisive = 19
 
const byte NAG_WhiteCrushing = 20
 
const byte NAG_BlackCrushing = 21
 
const byte NAG_ZugZwang = 22
 
const byte NAG_BlackZugZwang = 23
 
const byte NAG_MoreRoom = 26
 
const byte NAG_DevelopmentAdvantage = 35
 
const byte NAG_WithInitiative = 36
 
const byte NAG_WithAttack = 40
 
const byte NAG_WithBlackAttack = 41
 
const byte NAG_Compensation = 44
 
const byte NAG_SlightCentre = 48
 
const byte NAG_Centre = 50
 
const byte NAG_SlightKingSide = 54
 
const byte NAG_ModerateKingSide = 56
 
const byte NAG_KingSide = 58
 
const byte NAG_SlightQueenSide = 60
 
const byte NAG_ModerateQueenSide = 62
 
const byte NAG_QueenSide = 64
 
const byte NAG_SlightCounterPlay = 130
 
const byte NAG_CounterPlay = 132
 
const byte NAG_DecisiveCounterPlay = 134
 
const byte NAG_BlackSlightCounterPlay = 131
 
const byte NAG_BlackCounterPlay = 133
 
const byte NAG_BlackDecisiveCounterPlay = 135
 
const byte NAG_TimeLimit = 136
 
const byte NAG_WithIdea = 140
 
const byte NAG_BetterIs = 142
 
const byte NAG_VariousMoves = 144
 
const byte NAG_Comment = 145
 
const byte NAG_Novelty = 146
 
const byte NAG_WeakPoint = 147
 
const byte NAG_Ending = 148
 
const byte NAG_File = 149
 
const byte NAG_Diagonal = 150
 
const byte NAG_BishopPair = 151
 
const byte NAG_OppositeBishops = 153
 
const byte NAG_SameBishops = 154
 
const byte NAG_Etc = 190
 
const byte NAG_DoublePawns = 191
 
const byte NAG_SeparatedPawns = 192
 
const byte NAG_UnitedPawns = 193
 
const byte NAG_Diagram = 201
 
const byte NAG_See = 210
 
const byte NAG_Mate = 211
 
const byte NAG_PassedPawn = 212
 
const byte NAG_MorePawns = 213
 
const byte NAG_With = 214
 
const byte NAG_Without = 215
 
const byte MAX_NAGS_ARRAY = 215
 

Macro Definition Documentation

◆ GAME_DECODE_ALL

#define GAME_DECODE_ALL   3

Definition at line 128 of file game.h.

◆ GAME_DECODE_COMMENTS

#define GAME_DECODE_COMMENTS   2

Definition at line 127 of file game.h.

◆ GAME_DECODE_NONE

#define GAME_DECODE_NONE   0

Definition at line 125 of file game.h.

◆ GAME_DECODE_TAGS

#define GAME_DECODE_TAGS   1

Definition at line 126 of file game.h.

◆ PGN_STYLE_COLUMN

#define PGN_STYLE_COLUMN   256

Definition at line 152 of file game.h.

◆ PGN_STYLE_COMMENTS

#define PGN_STYLE_COMMENTS   2

Definition at line 145 of file game.h.

◆ PGN_STYLE_INDENT_COMMENTS

#define PGN_STYLE_INDENT_COMMENTS   8

Definition at line 147 of file game.h.

◆ PGN_STYLE_INDENT_VARS

#define PGN_STYLE_INDENT_VARS   16

Definition at line 148 of file game.h.

◆ PGN_STYLE_MOVENUM_SPACE

#define PGN_STYLE_MOVENUM_SPACE   128

Definition at line 151 of file game.h.

◆ PGN_STYLE_NO_NULL_MOVES

#define PGN_STYLE_NO_NULL_MOVES   2048

Definition at line 155 of file game.h.

◆ PGN_STYLE_SCIDFLAGS

#define PGN_STYLE_SCIDFLAGS   512

Definition at line 153 of file game.h.

◆ PGN_STYLE_SHORT_HEADER

#define PGN_STYLE_SHORT_HEADER   64

Definition at line 150 of file game.h.

◆ PGN_STYLE_STRIP_MARKS

#define PGN_STYLE_STRIP_MARKS   1024

Definition at line 154 of file game.h.

◆ PGN_STYLE_SYMBOLS

#define PGN_STYLE_SYMBOLS   32

Definition at line 149 of file game.h.

◆ PGN_STYLE_TAGS

#define PGN_STYLE_TAGS   1

Definition at line 144 of file game.h.

◆ PGN_STYLE_UNICODE

#define PGN_STYLE_UNICODE   4096

Definition at line 156 of file game.h.

◆ PGN_STYLE_VARS

#define PGN_STYLE_VARS   4

Definition at line 146 of file game.h.

Enumeration Type Documentation

◆ gameExactMatchT

Enumerator
GAME_EXACT_MATCH_Exact 
GAME_EXACT_MATCH_Pawns 
GAME_EXACT_MATCH_Fyles 
GAME_EXACT_MATCH_Material 

Definition at line 130 of file game.h.

◆ gameFormatT

Enumerator
PGN_FORMAT_Plain 
PGN_FORMAT_HTML 
PGN_FORMAT_LaTeX 
PGN_FORMAT_Color 

Definition at line 137 of file game.h.

Function Documentation

◆ game_parseNag()

byte game_parseNag ( std::pair< const char *, const char *>  strview)

Definition at line 140 of file game.cpp.

◆ game_printNag()

void game_printNag ( byte  nag,
char *  str,
bool  asSymbol,
gameFormatT  format 
)

Definition at line 98 of file game.cpp.

◆ strGetRatingType()

uint strGetRatingType ( const char *  name)

Definition at line 80 of file game.cpp.

◆ transPieces()

void transPieces ( char *  s)

Definition at line 41 of file game.cpp.

◆ transPiecesChar()

char transPiecesChar ( char  c)

Definition at line 59 of file game.cpp.

Variable Documentation

◆ langPieces

const char* langPieces[]

Definition at line 33 of file game.cpp.

◆ language

int language

Definition at line 28 of file game.cpp.

◆ MAX_NAGS_ARRAY

const byte MAX_NAGS_ARRAY = 215

Definition at line 111 of file game.h.

◆ NAG_BetterIs

const byte NAG_BetterIs = 142

Definition at line 87 of file game.h.

◆ NAG_BishopPair

const byte NAG_BishopPair = 151

Definition at line 95 of file game.h.

◆ NAG_BlackClear

const byte NAG_BlackClear = 17

Definition at line 58 of file game.h.

◆ NAG_BlackCounterPlay

const byte NAG_BlackCounterPlay = 133

Definition at line 83 of file game.h.

◆ NAG_BlackCrushing

const byte NAG_BlackCrushing = 21

Definition at line 62 of file game.h.

◆ NAG_BlackDecisive

const byte NAG_BlackDecisive = 19

Definition at line 60 of file game.h.

◆ NAG_BlackDecisiveCounterPlay

const byte NAG_BlackDecisiveCounterPlay = 135

Definition at line 84 of file game.h.

◆ NAG_BlackSlight

const byte NAG_BlackSlight = 15

Definition at line 56 of file game.h.

◆ NAG_BlackSlightCounterPlay

const byte NAG_BlackSlightCounterPlay = 131

Definition at line 82 of file game.h.

◆ NAG_BlackZugZwang

const byte NAG_BlackZugZwang = 23

Definition at line 64 of file game.h.

◆ NAG_Blunder

const byte NAG_Blunder = 4

Definition at line 49 of file game.h.

◆ NAG_Centre

const byte NAG_Centre = 50

Definition at line 72 of file game.h.

◆ NAG_Comment

const byte NAG_Comment = 145

Definition at line 89 of file game.h.

◆ NAG_Compensation

const byte NAG_Compensation = 44

Definition at line 70 of file game.h.

◆ NAG_CounterPlay

const byte NAG_CounterPlay = 132

Definition at line 80 of file game.h.

◆ NAG_DecisiveCounterPlay

const byte NAG_DecisiveCounterPlay = 134

Definition at line 81 of file game.h.

◆ NAG_DevelopmentAdvantage

const byte NAG_DevelopmentAdvantage = 35

Definition at line 66 of file game.h.

◆ NAG_Diagonal

const byte NAG_Diagonal = 150

Definition at line 94 of file game.h.

◆ NAG_Diagram

const byte NAG_Diagram = 201

Definition at line 102 of file game.h.

◆ NAG_DoublePawns

const byte NAG_DoublePawns = 191

Definition at line 99 of file game.h.

◆ NAG_DubiousMove

const byte NAG_DubiousMove = 6

Definition at line 51 of file game.h.

◆ NAG_Ending

const byte NAG_Ending = 148

Definition at line 92 of file game.h.

◆ NAG_Equal

const byte NAG_Equal = 10

Definition at line 53 of file game.h.

◆ NAG_Etc

const byte NAG_Etc = 190

Definition at line 98 of file game.h.

◆ NAG_ExcellentMove

const byte NAG_ExcellentMove = 3

Definition at line 48 of file game.h.

◆ NAG_File

const byte NAG_File = 149

Definition at line 93 of file game.h.

◆ NAG_GoodMove

const byte NAG_GoodMove = 1

Definition at line 46 of file game.h.

◆ NAG_InterestingMove

const byte NAG_InterestingMove = 5

Definition at line 50 of file game.h.

◆ NAG_KingSide

const byte NAG_KingSide = 58

Definition at line 75 of file game.h.

◆ NAG_Mate

const byte NAG_Mate = 211

Definition at line 104 of file game.h.

◆ NAG_ModerateKingSide

const byte NAG_ModerateKingSide = 56

Definition at line 74 of file game.h.

◆ NAG_ModerateQueenSide

const byte NAG_ModerateQueenSide = 62

Definition at line 77 of file game.h.

◆ NAG_MorePawns

const byte NAG_MorePawns = 213

Definition at line 106 of file game.h.

◆ NAG_MoreRoom

const byte NAG_MoreRoom = 26

Definition at line 65 of file game.h.

◆ NAG_Novelty

const byte NAG_Novelty = 146

Definition at line 90 of file game.h.

◆ NAG_OnlyMove

const byte NAG_OnlyMove = 8

Definition at line 52 of file game.h.

◆ NAG_OppositeBishops

const byte NAG_OppositeBishops = 153

Definition at line 96 of file game.h.

◆ NAG_PassedPawn

const byte NAG_PassedPawn = 212

Definition at line 105 of file game.h.

◆ NAG_PoorMove

const byte NAG_PoorMove = 2

Definition at line 47 of file game.h.

◆ NAG_QueenSide

const byte NAG_QueenSide = 64

Definition at line 78 of file game.h.

◆ NAG_SameBishops

const byte NAG_SameBishops = 154

Definition at line 97 of file game.h.

◆ NAG_See

const byte NAG_See = 210

Definition at line 103 of file game.h.

◆ NAG_SeparatedPawns

const byte NAG_SeparatedPawns = 192

Definition at line 100 of file game.h.

◆ NAG_SlightCentre

const byte NAG_SlightCentre = 48

Definition at line 71 of file game.h.

◆ NAG_SlightCounterPlay

const byte NAG_SlightCounterPlay = 130

Definition at line 79 of file game.h.

◆ NAG_SlightKingSide

const byte NAG_SlightKingSide = 54

Definition at line 73 of file game.h.

◆ NAG_SlightQueenSide

const byte NAG_SlightQueenSide = 60

Definition at line 76 of file game.h.

◆ NAG_TimeLimit

const byte NAG_TimeLimit = 136

Definition at line 85 of file game.h.

◆ NAG_Unclear

const byte NAG_Unclear = 13

Definition at line 54 of file game.h.

◆ NAG_UnitedPawns

const byte NAG_UnitedPawns = 193

Definition at line 101 of file game.h.

◆ NAG_VariousMoves

const byte NAG_VariousMoves = 144

Definition at line 88 of file game.h.

◆ NAG_WeakPoint

const byte NAG_WeakPoint = 147

Definition at line 91 of file game.h.

◆ NAG_WhiteClear

const byte NAG_WhiteClear = 16

Definition at line 57 of file game.h.

◆ NAG_WhiteCrushing

const byte NAG_WhiteCrushing = 20

Definition at line 61 of file game.h.

◆ NAG_WhiteDecisive

const byte NAG_WhiteDecisive = 18

Definition at line 59 of file game.h.

◆ NAG_WhiteSlight

const byte NAG_WhiteSlight = 14

Definition at line 55 of file game.h.

◆ NAG_With

const byte NAG_With = 214

Definition at line 107 of file game.h.

◆ NAG_WithAttack

const byte NAG_WithAttack = 40

Definition at line 68 of file game.h.

◆ NAG_WithBlackAttack

const byte NAG_WithBlackAttack = 41

Definition at line 69 of file game.h.

◆ NAG_WithIdea

const byte NAG_WithIdea = 140

Definition at line 86 of file game.h.

◆ NAG_WithInitiative

const byte NAG_WithInitiative = 36

Definition at line 67 of file game.h.

◆ NAG_Without

const byte NAG_Without = 215

Definition at line 108 of file game.h.

◆ NAG_ZugZwang

const byte NAG_ZugZwang = 22

Definition at line 63 of file game.h.