kigo
#include <game.h>
Public Types | |
enum | FinalState { FinalAlive = 1, FinalDead, FinalSeki, FinalWhiteTerritory, FinalBlackTerritory, FinalDame, FinalStateInvalid } |
Public Slots | |
void | gameSetup () |
Signals | |
void | boardChanged () |
void | boardInitialized () |
void | boardSizeChanged (int) |
void | canRedoChanged (bool) |
void | canUndoChanged (bool) |
void | consecutivePassMovesPlayed (int) |
void | currentPlayerChanged (const Player &) |
void | passMovePlayed (const Player &) |
void | resigned (const Player &) |
void | waiting (bool) |
Public Member Functions | |
Game (QObject *parent=0) | |
~Game () | |
QList< Stone > | bestMoves (const Player &player) |
Player & | blackPlayer () |
const Player & | blackPlayer () const |
int | boardSize () const |
bool | canRedo () const |
bool | canUndo () const |
int | captures (const Player &player) |
int | currentMoveNumber () const |
Player & | currentPlayer () |
const Player & | currentPlayer () const |
QString | engineCommand () const |
QString | engineName () const |
QString | engineVersion () const |
Score | estimatedScore () |
Score | finalScore () |
FinalState | finalState (const Stone &field) |
QList< Stone > | finalStates (FinalState state) |
int | fixedHandicap () const |
int | fixedHandicapUpperBound () |
bool | generateMove (const Player &player, bool undoable=true) |
bool | init () |
bool | init (const QString &fileName, int moveNumber=0) |
bool | isFinished () const |
bool | isRunning () const |
float | komi () const |
Move | lastMove () const |
QList< Stone > | legalMoves (const Player &player) |
QList< Stone > | liberties (const Stone &field) |
int | moveCount () |
QList< Move > | moves (const Player &player) |
QList< Move > | moves () |
bool | playMove (const Move &move, bool undoable=true) |
bool | playMove (const Player &player, const Stone &stone=Stone(), bool undoable=true) |
bool | redoMove () |
bool | save (const QString &fileName) |
bool | setBoardSize (int size) |
bool | setFixedHandicap (int handicap) |
bool | setKomi (float komi) |
bool | start (const QString &command="gnugo --mode gtp") |
QList< Stone > | stones (const Player &player) |
void | stop () |
bool | undoMove () |
QUndoStack * | undoStack () |
Player & | whitePlayer () |
const Player & | whitePlayer () const |
Detailed Description
The Game class implements the Go game and acts as a wrapper around a remote Go Game game implementing the Go Text Protocol (GTP).
It uses GTP protocol version 2 and interfaces the game executable in an synchronous manor. The best supported game should (naturally) be GnuGo.
- Since
- 0.1
Member Enumeration Documentation
Enumeration of all possible final states of a field when a game is over.
Constructor & Destructor Documentation
Member Function Documentation
|
signal |
This signal is emitted when the board situation changed and can be used to trigger an update to a visual representation.
|
signal |
This signal is emitted when the board is first started and can be used to trigger an update to a visual representation.
|
signal |
This signal is emitted when the board size was changed.
|
signal |
This signal is emitted when availability of redo moves changes.
|
signal |
This signal is emitted when availability of undo moves changes.
int Kigo::Game::captures | ( | const Player & | player | ) |
|
signal |
This signal is emitted when both players played a pass move after another.
It is also send when pass moves are gone (which is indicated by a value of 0).
|
signal |
This signal is emitted when the current player changes.
Score Kigo::Game::estimatedScore | ( | ) |
Score Kigo::Game::finalScore | ( | ) |
Compute the score of a finished game.
This method can take a long time to complete. It is thus recommended to use estimatedScore().
- Returns
- Score in SGF format (RE property)
Game::FinalState Kigo::Game::finalState | ( | const Stone & | field | ) |
Report the final status of a field in a finished game.
- Parameters
-
field Report status for that feed
- See also
- FinalState
QList< Stone > Kigo::Game::finalStates | ( | FinalState | state | ) |
Report fields with a specified final status in a finished game.
- Parameters
-
state Report only fields with that state
- See also
- FinalState
int Kigo::Game::fixedHandicapUpperBound | ( | ) |
bool Kigo::Game::generateMove | ( | const Player & | player, |
bool | undoable = true |
||
) |
bool Kigo::Game::init | ( | const QString & | fileName, |
int | moveNumber = 0 |
||
) |
|
inline |
Move Kigo::Game::lastMove | ( | ) | const |
int Kigo::Game::moveCount | ( | ) |
|
signal |
bool Kigo::Game::playMove | ( | const Move & | move, |
bool | undoable = true |
||
) |
|
signal |
This signal is emitted when a player resigns.
bool Kigo::Game::save | ( | const QString & | fileName | ) |
bool Kigo::Game::setBoardSize | ( | int | size | ) |
bool Kigo::Game::setFixedHandicap | ( | int | handicap | ) |
bool Kigo::Game::setKomi | ( | float | komi | ) |
bool Kigo::Game::start | ( | const QString & | command = "gnugo --mode gtp" | ) |
void Kigo::Game::stop | ( | ) |
|
signal |
This signal is emitted when the game starts or ends a non-blocking wait.
This is useful to reflect the wait state in the UI.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:44:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.