// $Id: COsGame.htm 119 2004-05-16 00:02:24Z ggs_mburo $ // This is a GGS file, licensed under the GPL COsGame

COsGame

The COsGame class includes everything that is known about a game - players, positions, clocks, game type, and so on.

Normal Usage

You will need to give your program whatever information it needs to make a move (in its GetMove() routine) and to learn from a game (if it does so). This includes converting the position into your program's internal format; see COsPosition and COsBoard for some useful functions.

The game can also be stored or loaded. GGF ("Generic Game File") is the standard file format. This file format is used by GGF so you can also use the << and >> operators to load and save games downloaded from GGS.

Members

Variables
string sPlaceLocation of the game, e.g. "GGS/os"
string sDateTimeDate and time of the game, e.g. "2001-2-26 18:48 EST".
COsPlayerInfo pis[2]Information about the players. WHITE is pis[1].
COsPosition posStartStarting position (board, clocks) for the game.
COsPosition posCurrent position (board, clocks) for the game.
COsMoveList mlvector of COsMoveListItems for the game so far.
COsMatchType mtGame type information, see COsMatchType for details.
double dResultOnly for games that are finished.
Creation
Clear()Clear the game and all variables.
Modification
Update()Update the game with a COsMoveListItem.
Information
GameOver()Return true if the game is over.
ToMove()Return true if the player with the given logon is to move.
I/O
In()Reads from a stream in the GGF format, normally use the >> operator.
Out()Write to a stream in GGF format, normally use the << operator.
InLogbook()Reads from a stream in logbook.gam format (Logistello opening book).
InIOS()Reads from a stream in IOS format.