C# Class Go.Board

Afficher le fichier Open project: paviad/GoSharp Class Usage Examples

Méthodes publiques

Méthode Description
Board ( ) : System

Construct a board object from a parameter array. Each parameter may be 0 for empty, 1 for black or 2 for white, and the number of parameters must be a square of a natural number. The board size will be a square whose side length is the square root of the number of parameters.

Board ( Board fromBoard ) : System

Constructs a board object from an existing board object, copying its size and content.

Board ( int sx, int sy ) : System

Constructs a board object of specified horizontal and vertical size.

GetContentAt ( Point n ) : Content

Gets the board content at the specified point.

GetContentAt ( int x, int y ) : Content

Gets the board content at the specified point.

GetGroupAt ( Point n ) : Go.Group

Gets the group including the board content at the specified position.

GetGroupAt ( int x, int y ) : Go.Group

Gets the group including the board content at the specified position.

GetHashCode ( ) : int

Gets a hash code of this board. Hash code includes board content.

GetLiberties ( Go.Group group ) : int

Gets the liberty count of the specified group.

GetLiberties ( Point n ) : int

Gets the liberty count of the group containing the board content at the specified point.

GetLiberties ( int x, int y ) : int

Gets the liberty count of the group containing the board content at the specified point.

ResetScoring ( ) : void

Resets the scoring process, unmarking dead groups.

SetContentAt ( Point p, Content content ) : void

Sets the board content at the specified point, this is not considered a game move, but rather a setup move.

SetContentAt ( int x, int y, Content c ) : void

Sets the board content at the specified point, this is not considered a game move, but rather a setup move.

SetDeadGroup ( Point n ) : void

Marks a group as dead for the purposes of scoring. This method has no effect if the board is not in scoring mode (see the IsScoring property).

SetDeadGroup ( int x, int y ) : void

Marks a group as dead for the purposes of scoring. This method has no effect if the board is not in scoring mode (see the IsScoring property).

ToString ( ) : string

Returns a multi-line string representation of the board with the scoring state. Each spot is composed of two characters. The first is one of [.XO] representing an empty, black or white board content respectively. The second is one of [.xoD] representing unowned, black or white territory, or D for a dead group.

this ( Point n ) : Content

Gets or sets the board content at the specified point. Changing the board content using this property is not considered a game move, but rather a setup move.

this ( int x, int y ) : Content

Gets or sets the board content at the specified point. Changing the board content using this property is not considered a game move, but rather a setup move.

Private Methods

Méthode Description
CalcTerritory ( ) : void
Capture ( Go.Group g ) : int
Capture ( IEnumerable captures ) : int
ClearGroupCache ( ) : void
GetCapturedGroups ( int x, int y ) : List
GetContentHashCode ( ) : int
GetStoneNeighbours ( int x, int y ) : List
RecursiveAddPoint ( Go.Group group, int x, int y ) : void

Method Details

Board() public méthode

Construct a board object from a parameter array. Each parameter may be 0 for empty, 1 for black or 2 for white, and the number of parameters must be a square of a natural number. The board size will be a square whose side length is the square root of the number of parameters.
public Board ( ) : System
Résultat System

Board() public méthode

Constructs a board object from an existing board object, copying its size and content.
public Board ( Board fromBoard ) : System
fromBoard Board The source board object.
Résultat System

Board() public méthode

Constructs a board object of specified horizontal and vertical size.
public Board ( int sx, int sy ) : System
sx int The horizontal size of the board.
sy int The vertical size of the board.
Résultat System

GetContentAt() public méthode

Gets the board content at the specified point.
public GetContentAt ( Point n ) : Content
n Point The coordinates of the position.
Résultat Content

GetContentAt() public méthode

Gets the board content at the specified point.
public GetContentAt ( int x, int y ) : Content
x int The X coordinate of the position.
y int The Y coordinate of the position.
Résultat Content

GetGroupAt() public méthode

Gets the group including the board content at the specified position.
public GetGroupAt ( Point n ) : Go.Group
n Point The coordinates of the position.
Résultat Go.Group

GetGroupAt() public méthode

Gets the group including the board content at the specified position.
public GetGroupAt ( int x, int y ) : Go.Group
x int The X coordinate of the position.
y int The Y coordinate of the position.
Résultat Go.Group

GetHashCode() public méthode

Gets a hash code of this board. Hash code includes board content.
public GetHashCode ( ) : int
Résultat int

GetLiberties() public méthode

Gets the liberty count of the specified group.
public GetLiberties ( Go.Group group ) : int
group Go.Group The group object.
Résultat int

GetLiberties() public méthode

Gets the liberty count of the group containing the board content at the specified point.
public GetLiberties ( Point n ) : int
n Point The coordinates of the position.
Résultat int

GetLiberties() public méthode

Gets the liberty count of the group containing the board content at the specified point.
public GetLiberties ( int x, int y ) : int
x int The X coordinate of the position.
y int The Y coordinate of the position.
Résultat int

ResetScoring() public méthode

Resets the scoring process, unmarking dead groups.
public ResetScoring ( ) : void
Résultat void

SetContentAt() public méthode

Sets the board content at the specified point, this is not considered a game move, but rather a setup move.
public SetContentAt ( Point p, Content content ) : void
p Point The coordinates of the position.
content Content The new content at the position.
Résultat void

SetContentAt() public méthode

Sets the board content at the specified point, this is not considered a game move, but rather a setup move.
public SetContentAt ( int x, int y, Content c ) : void
x int The X coordinate of the position.
y int The Y coordinate of the position.
c Content The new content at the position.
Résultat void

SetDeadGroup() public méthode

Marks a group as dead for the purposes of scoring. This method has no effect if the board is not in scoring mode (see the IsScoring property).
public SetDeadGroup ( Point n ) : void
n Point The coordinates of the position of a stone in the group.
Résultat void

SetDeadGroup() public méthode

Marks a group as dead for the purposes of scoring. This method has no effect if the board is not in scoring mode (see the IsScoring property).
public SetDeadGroup ( int x, int y ) : void
x int The X coordinate of a position belonging to the group.
y int The Y coordinate of a position belonging to the group.
Résultat void

ToString() public méthode

Returns a multi-line string representation of the board with the scoring state. Each spot is composed of two characters. The first is one of [.XO] representing an empty, black or white board content respectively. The second is one of [.xoD] representing unowned, black or white territory, or D for a dead group.
public ToString ( ) : string
Résultat string

this() public méthode

Gets or sets the board content at the specified point. Changing the board content using this property is not considered a game move, but rather a setup move.
public this ( Point n ) : Content
n Point The coordinates of the position.
Résultat Content

this() public méthode

Gets or sets the board content at the specified point. Changing the board content using this property is not considered a game move, but rather a setup move.
public this ( int x, int y ) : Content
x int The X coordinate of the position.
y int The Y coordinate of the position.
Résultat Content