C# 클래스 Go.Board

파일 보기 프로젝트 열기: paviad/GoSharp 1 사용 예제들

공개 메소드들

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

비공개 메소드들

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

메소드 상세

Board() 공개 메소드

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
리턴 System

Board() 공개 메소드

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.
리턴 System

Board() 공개 메소드

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.
리턴 System

GetContentAt() 공개 메소드

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

GetContentAt() 공개 메소드

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.
리턴 Content

GetGroupAt() 공개 메소드

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

GetGroupAt() 공개 메소드

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.
리턴 Go.Group

GetHashCode() 공개 메소드

Gets a hash code of this board. Hash code includes board content.
public GetHashCode ( ) : int
리턴 int

GetLiberties() 공개 메소드

Gets the liberty count of the specified group.
public GetLiberties ( Go.Group group ) : int
group Go.Group The group object.
리턴 int

GetLiberties() 공개 메소드

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.
리턴 int

GetLiberties() 공개 메소드

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.
리턴 int

ResetScoring() 공개 메소드

Resets the scoring process, unmarking dead groups.
public ResetScoring ( ) : void
리턴 void

SetContentAt() 공개 메소드

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.
리턴 void

SetContentAt() 공개 메소드

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.
리턴 void

SetDeadGroup() 공개 메소드

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.
리턴 void

SetDeadGroup() 공개 메소드

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.
리턴 void

ToString() 공개 메소드

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
리턴 string

this() 공개 메소드

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.
리턴 Content

this() 공개 메소드

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.
리턴 Content