C# 클래스 GR.Gambling.Backgammon.Tools.GnuBg

파일 보기 프로젝트 열기: alexhanh/Botting-Library 1 사용 예제들

공개 메소드들

메소드 설명
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