Method | Description | |
---|---|---|
AddToPoint ( int player, int point, int count ) : void | ||
Board ( ) : System | ||
Board ( |
Deep-copy constructor.
|
|
BoardRelativeTo ( int player ) : int[] |
Returns the board relative to the player, so that the slots 0-5 match the player's home board. Negative counts indicate opponents checkers.
|
|
CapturedCount ( int player ) : int | ||
Clone ( ) : |
Creates a deep-copy of this board.
|
|
DecreaseCaptured ( int player ) : void | ||
DecreaseFinished ( int player ) : void | ||
Deserialize ( string s ) : |
||
Empty ( ) : void | ||
EmptyPoint ( int player, int point ) : void | ||
Equals ( |
||
FinishedCount ( int player ) : int | ||
ForcedMoves ( List |
A move is a forced move if it must be made before other moves and every move hint share the same forced move.
|
|
HashString ( ) : string |
Provides a unique hash string for each different board position.
|
|
IncreaseCaptured ( int player ) : void | ||
IncreaseCaptured ( int player, int count ) : void | ||
IncreaseFinished ( int player ) : void | ||
IncreaseFinished ( int player, int count ) : void | ||
InitializeBoard ( BackgammonVariation variation ) : void | ||
IsBearoff ( int player ) : bool |
Returns true if player's all chequers are on his home board and is bearing off.
|
|
IsLegal ( ) : bool | ||
IsLegalMove ( int player, Move move, int die ) : bool |
Returns if the given move for the given player is a valid move.
|
|
IsPureRace ( ) : bool |
Returns true if both player's checkers have "passed" each others so that it's impossible to hit or block anymore. Source: http://www.bkgm.com/gloss/lookup.cgi?pure+race
|
|
IsStartingPosition ( BackgammonVariation variation ) : bool | ||
LastChequer ( int player ) : int |
Returns the point of the last chequer of the player from the player's perspective. Returns 24 for captured and -1 if all checkers have been bearoffed.
|
|
LegalPlays ( int player, int dice ) : List |
This returns all the possible legal moves for the player with given dice. It sorts the dice from highest to lowest, so it produces same results regardless of the dice order. It also finds correctly moves according to following rules: "For any roll, if a player can move both dice, that player is compelled to do so. If it is possible to move either die, but not both, the higher number must be played. Further, if one die is unable to be moved, but such a move is made possible by the moving of the other die, that move is compulsory." Source: http://en.wikipedia.org/wiki/Backgammon
|
|
MakeMove ( int player, Move move ) : void |
Applys a given move to this board. This method assumes the move is valid.
|
|
MakeMoves ( int player, IEnumerable |
||
MakePlay ( int player, Play play ) : void | ||
PipCount ( int player ) : int | ||
PointCount ( int player, int point ) : int |
Returns the count of this player's perspective. Count is negative if opponent has checkers on the given slot.
|
|
RemoveFromPoint ( int player, int point, int count ) : void | ||
ResignationValue ( int player ) : ResignValue |
Returns the current resign value for the player based on the last chequer's position.
|
|
Serialize ( |
||
SetCaptured ( int player, int count ) : void | ||
SetFinished ( int player, int count ) : void | ||
SetPoint ( int player, int point, int count ) : void |
Sets the given slot to count from player's perspective.
|
|
ToString ( ) : string | ||
ToString ( int player ) : string |
Gnubg style rendering of the board from the perspective of player. X is always the player's checkers, O opponent's.
|
|
UndoMove ( int player, Move move ) : void |
Reverses a given move that was made. Notice that if you are reversing a made move sequence, you need to do it in reverse order, that is, undo the last made move first, then the second last, and so on.
|
|
UndoPlay ( int player, Play play ) : void |
|
Method | Description | |
---|---|---|
Recursion ( int player, List |
public AddToPoint ( int player, int point, int count ) : void | ||
player | int | |
point | int | |
count | int | |
return | void |
public BoardRelativeTo ( int player ) : int[] | ||
player | int | |
return | int[] |
public DecreaseCaptured ( int player ) : void | ||
player | int | |
return | void |
public DecreaseFinished ( int player ) : void | ||
player | int | |
return | void |
public static Deserialize ( string s ) : |
||
s | string | |
return |
public EmptyPoint ( int player, int point ) : void | ||
player | int | |
point | int | |
return | void |
public static ForcedMoves ( List |
||
legal_move_sequences | List |
|
return | List |
public IncreaseCaptured ( int player ) : void | ||
player | int | |
return | void |
public IncreaseCaptured ( int player, int count ) : void | ||
player | int | |
count | int | |
return | void |
public IncreaseFinished ( int player ) : void | ||
player | int | |
return | void |
public IncreaseFinished ( int player, int count ) : void | ||
player | int | |
count | int | |
return | void |
public InitializeBoard ( BackgammonVariation variation ) : void | ||
variation | BackgammonVariation | |
return | void |
public IsLegalMove ( int player, Move move, int die ) : bool | ||
player | int | The player for whom the move is made. |
move | Move | The move to be made, slot indices must be relative to the player making the move. |
die | int | The die with which the move is made. |
return | bool |
public IsStartingPosition ( BackgammonVariation variation ) : bool | ||
variation | BackgammonVariation | |
return | bool |
public LegalPlays ( int player, int dice ) : List |
||
player | int | |
dice | int | |
return | List |
public MakeMove ( int player, Move move ) : void | ||
player | int | |
move | Move | |
return | void |
public MakeMoves ( int player, IEnumerable |
||
player | int | |
moves | IEnumerable |
|
return | void |
public MakePlay ( int player, Play play ) : void | ||
player | int | |
play | Play | |
return | void |
public PointCount ( int player, int point ) : int | ||
player | int | Relative player from whos perspective the query is made. |
point | int | |
return | int |
public RemoveFromPoint ( int player, int point, int count ) : void | ||
player | int | |
point | int | |
count | int | |
return | void |
public ResignationValue ( int player ) : ResignValue | ||
player | int | |
return | ResignValue |
public static Serialize ( |
||
board | ||
return | string |
public SetCaptured ( int player, int count ) : void | ||
player | int | |
count | int | |
return | void |
public SetFinished ( int player, int count ) : void | ||
player | int | |
count | int | |
return | void |
public SetPoint ( int player, int point, int count ) : void | ||
player | int | The player from whose perspective the slot is mapped. |
point | int | |
count | int | Positive count is for the player, negative for the opponent. Zero count empties the slot for both players. |
return | void |
public UndoMove ( int player, Move move ) : void | ||
player | int | |
move | Move | |
return | void |
public UndoPlay ( int player, Play play ) : void | ||
player | int | |
play | Play | The play in which moves are in the order they were applied to the board and not reversed. |
return | void |