C# Класс GR.Gambling.Backgammon.Tools.GnuBg

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BoardFromPositionID ( string position_id, string &error ) : Board
BoolListToInt ( IEnumerable bools ) : int
Command ( string s ) : string

Sends a command to the gnubg and returns gnubg's response.

DoubleHint ( GameState gamestate ) : DoubleHint
DoubleResponseHint ( GameState gamestate ) : DoubleResponseHint
Eval ( GameState gamestate ) : EvaluationInfo
Exit ( ) : void

Tries to close the gnubg process the "natural" way by using the exit command. If it doesn't exit in max 3000(ms), it kills the running process.

GnuBGIDToGameState ( string gnubg_id, string &error ) : GameState
GnuBg ( string path ) : System
Hint ( GameState gamestate ) : string
MatchID ( GameState gamestate ) : string

TODO: Solve the "I'm sorry, but SetMatchID cannot handle positions where a double has been offered" bullshit.

PlayHint ( GameState gamestate, int max_hints ) : List

Assumes dice have been rolled and game is still going.

PlayHint ( GameState gamestate ) : PlayHint
ResignResponseHint ( GameState gamestate ) : ResignResponseHint
SetGameState ( GameState gamestate ) : void

Doesn't use the match id for setting up the position.

Start ( ) : void
ToPositionID ( Board board, int player_on_roll ) : string

Приватные методы

Метод Описание
GetDoubleHint ( GameState gamestate ) : DoubleHint
MatchID ( int die1, int die2, int turn, int resigned, int doubled, int move, int cube_owner, int crawford, int match_to, int score1, int score2, int cube, int gamestate ) : string
ParseDoubleAction ( string hint ) : DoubleAction
ParseDoubleResponse ( string hint ) : DoubleResponseHint
ParseMoveHint ( string move_string, int &count, int total_hints, int dice, GameState gamestate ) : Move
ParseMoveHints ( string hints, int dice, GameState gamestate ) : List
ParseResignResponse ( string hint ) : ResignResponseHint
Set0PlyEvaluation ( ) : void
Set0PlyEvaluation ( double noise ) : void
Set2PlyEvaluation ( ) : void
SetBoardSimple ( GameState gamestate ) : void

Gnubg treats positive counts as for the player on turn, and negative for the other. The first slot is the captured count for the player on turn, last slot is for the capture count of the other. Gnubg calculates the finished pieces for both players automatically. 26 integers are represented the following way: #Captured count for the player on roll# #Slot 1# ... #Slot 24# #Captured count for the other player# The slots start from the home board of the player on roll.

SetOptions ( ) : void

Описание методов

BoardFromPositionID() публичный статический Метод

public static BoardFromPositionID ( string position_id, string &error ) : Board
position_id string
error string
Результат GR.Gambling.Backgammon.Board

BoolListToInt() публичный статический Метод

public static BoolListToInt ( IEnumerable bools ) : int
bools IEnumerable
Результат int

Command() публичный Метод

Sends a command to the gnubg and returns gnubg's response.
public Command ( string s ) : string
s string
Результат string

DoubleHint() публичный Метод

public DoubleHint ( GameState gamestate ) : DoubleHint
gamestate GR.Gambling.Backgammon.GameState
Результат DoubleHint

DoubleResponseHint() публичный Метод

public DoubleResponseHint ( GameState gamestate ) : DoubleResponseHint
gamestate GR.Gambling.Backgammon.GameState
Результат DoubleResponseHint

Eval() публичный Метод

public Eval ( GameState gamestate ) : EvaluationInfo
gamestate GR.Gambling.Backgammon.GameState
Результат EvaluationInfo

Exit() публичный Метод

Tries to close the gnubg process the "natural" way by using the exit command. If it doesn't exit in max 3000(ms), it kills the running process.
public Exit ( ) : void
Результат void

GnuBGIDToGameState() публичный статический Метод

public static GnuBGIDToGameState ( string gnubg_id, string &error ) : GameState
gnubg_id string
error string
Результат GR.Gambling.Backgammon.GameState

GnuBg() публичный Метод

public GnuBg ( string path ) : System
path string
Результат System

Hint() публичный Метод

public Hint ( GameState gamestate ) : string
gamestate GR.Gambling.Backgammon.GameState
Результат string

MatchID() публичный статический Метод

TODO: Solve the "I'm sorry, but SetMatchID cannot handle positions where a double has been offered" bullshit.
public static MatchID ( GameState gamestate ) : string
gamestate GR.Gambling.Backgammon.GameState
Результат string

PlayHint() публичный Метод

Assumes dice have been rolled and game is still going.
public PlayHint ( GameState gamestate, int max_hints ) : List
gamestate GR.Gambling.Backgammon.GameState
max_hints int
Результат List

PlayHint() публичный Метод

public PlayHint ( GameState gamestate ) : PlayHint
gamestate GR.Gambling.Backgammon.GameState
Результат PlayHint

ResignResponseHint() публичный Метод

public ResignResponseHint ( GameState gamestate ) : ResignResponseHint
gamestate GR.Gambling.Backgammon.GameState
Результат ResignResponseHint

SetGameState() публичный Метод

Doesn't use the match id for setting up the position.
public SetGameState ( GameState gamestate ) : void
gamestate GR.Gambling.Backgammon.GameState
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

ToPositionID() публичный статический Метод

public static ToPositionID ( Board board, int player_on_roll ) : string
board GR.Gambling.Backgammon.Board
player_on_roll int
Результат string