C# 클래스 Go.Game

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

공개 프로퍼티들

프로퍼티 타입 설명
PassMove Point
SuperKoComparer SuperKoComparer

공개 메소드들

메소드 설명
Game ( Go.GameInfo gi ) : System

Constructs a root game object based on a GameInfo object.

Game ( Go.SGFGameTree sgfGameTree ) : System

Constructs a root game object, along with a complete game tree from the specified SGFGameTree object.

MakeMove ( Point n ) : Game

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. The legality of the move may be determined by examining the IsLegal property of the returned object.

MakeMove ( Point n, bool &legal ) : Game

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. If the move was illegal (suicide, violating super-ko, or an overwrite), the method sets the legal parameter to false, otherwise it is set to true.

MakeMove ( int x, int y ) : Game

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. The legality of the move may be determined by examining the IsLegal property of the returned object.

MakeMove ( int x, int y, bool &legal ) : Game

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. If the move was illegal (suicide, violating super-ko, or an overwrite), the method sets the legal parameter to false, otherwise it is set to true.

Pass ( ) : Game

Makes a 'pass' move and returns a new Game object representing the state after the move. The color of the move is determined by the Turn property.

SerializeFromSGF ( string path ) : List

Parses an SGF game file and creates a list of games.

SerializeToSGF ( TextWriter s ) : string

Converts the game tree into SGF format.

SetupMove ( Point p, Content c ) : void

Adds a stone to the board as a setup move.

SetupMove ( Point p1, Point p2, Content c ) : void

Adds stones to the board in a rectangular area.

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

Adds a stone to the board as a setup move.

SetupMove ( int x1, int y1, int x2, int y2, Content c ) : void

Adds stones to the board in a rectangular area.

보호된 메소드들

메소드 설명
Game ( Board bs, Content turn ) : System

Constructs a Game object from a Board object and a turn to play.

Game ( Game fromGame ) : System

Constructs a Game object from an existing Game object. This constructor is used when making game moves.

InternalMakeMove ( int x, int y ) : bool

Perform the necessary operations for a move, check liberties, capture, etc. Also updates the Move and IsLegal properties.

비공개 메소드들

메소드 설명
CreateGameTree ( Go.SGFGameTree root, Game p ) : void
Game ( ) : System
HandleBoardSize ( Go.SGFProperty p ) : Game
HandleHandicap ( Go.SGFProperty p ) : Game
HandleKomi ( Go.SGFProperty p ) : Game
HandleMove ( Go.SGFProperty p ) : Game
HandlePlayerTurn ( Go.SGFProperty p ) : Game
HandleSetup ( Go.SGFProperty p ) : Game
InitializeFromGameInfo ( ) : void
RemoveProperty ( string name ) : void
SerializeMove ( TextWriter s, Point pnt ) : void
SerializeSGFProperties ( TextWriter s ) : void
SerializeToSGFInternal ( TextWriter s ) : void
SetHandicap ( int handicap ) : void
SetProperty ( string name, string value, bool create ) : void

메소드 상세

Game() 보호된 메소드

Constructs a Game object from a Board object and a turn to play.
protected Game ( Board bs, Content turn ) : System
bs Board The source Board.
turn Content The color of the player whose turn it is to play.
리턴 System

Game() 보호된 메소드

Constructs a Game object from an existing Game object. This constructor is used when making game moves.
protected Game ( Game fromGame ) : System
fromGame Game The Game object before the move.
리턴 System

Game() 공개 메소드

Constructs a root game object based on a GameInfo object.
public Game ( Go.GameInfo gi ) : System
gi Go.GameInfo The GameInfo object.
리턴 System

Game() 공개 메소드

Constructs a root game object, along with a complete game tree from the specified SGFGameTree object.
public Game ( Go.SGFGameTree sgfGameTree ) : System
sgfGameTree Go.SGFGameTree The SGF game tree object.
리턴 System

InternalMakeMove() 보호된 메소드

Perform the necessary operations for a move, check liberties, capture, etc. Also updates the Move and IsLegal properties.
protected InternalMakeMove ( int x, int y ) : bool
x int The X coordinate of the move.
y int The Y coordinate of the move.
리턴 bool

MakeMove() 공개 메소드

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. The legality of the move may be determined by examining the IsLegal property of the returned object.
public MakeMove ( Point n ) : Game
n Point The coordinates of the move.
리턴 Game

MakeMove() 공개 메소드

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. If the move was illegal (suicide, violating super-ko, or an overwrite), the method sets the legal parameter to false, otherwise it is set to true.
public MakeMove ( Point n, bool &legal ) : Game
n Point The coordinates of the move.
legal bool Set to true if the move was legal, false otherwise.
리턴 Game

MakeMove() 공개 메소드

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. The legality of the move may be determined by examining the IsLegal property of the returned object.
public MakeMove ( int x, int y ) : Game
x int The X coordinate of the move.
y int The Y coordinate of the move.
리턴 Game

MakeMove() 공개 메소드

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. If the move was illegal (suicide, violating super-ko, or an overwrite), the method sets the legal parameter to false, otherwise it is set to true.
public MakeMove ( int x, int y, bool &legal ) : Game
x int The X coordinate of the move.
y int The Y coordinate of the move.
legal bool Set to true if the move was legal, false otherwise.
리턴 Game

Pass() 공개 메소드

Makes a 'pass' move and returns a new Game object representing the state after the move. The color of the move is determined by the Turn property.
public Pass ( ) : Game
리턴 Game

SerializeFromSGF() 공개 정적인 메소드

Parses an SGF game file and creates a list of games.
public static SerializeFromSGF ( string path ) : List
path string The path to the SGF file.
리턴 List

SerializeToSGF() 공개 메소드

Converts the game tree into SGF format.
public SerializeToSGF ( TextWriter s ) : string
s TextWriter A TextWriter object that will receive the output. /// If null, the output is returned as a string.
리턴 string

SetupMove() 공개 메소드

Adds a stone to the board as a setup move.
public SetupMove ( Point p, Content c ) : void
p Point The coordinates of the setup move.
c Content The color of the stone to add (or empty to clear).
리턴 void

SetupMove() 공개 메소드

Adds stones to the board in a rectangular area.
public SetupMove ( Point p1, Point p2, Content c ) : void
p1 Point The top left coordinates of the rectangle.
p2 Point The bottom right coordinates of the rectangle.
c Content The color of the stone to add (or empty to clear).
리턴 void

SetupMove() 공개 메소드

Adds a stone to the board as a setup move.
public SetupMove ( int x, int y, Content c ) : void
x int The X coordinate of the setup move.
y int The Y coordinate of the setup move.
c Content The color of the stone to add (or empty to clear).
리턴 void

SetupMove() 공개 메소드

Adds stones to the board in a rectangular area.
public SetupMove ( int x1, int y1, int x2, int y2, Content c ) : void
x1 int The left coordinate of the rectangle.
y1 int The top coordinate of the rectangle.
x2 int The right coordinate of the rectangle.
y2 int The bottom coordinate of the rectangle.
c Content The color of the stone to add (or empty to clear).
리턴 void

프로퍼티 상세

PassMove 공개적으로 정적으로 프로퍼티

Represents a 'pass' move.
public static Point PassMove
리턴 Point

SuperKoComparer 공개적으로 정적으로 프로퍼티

The singleton comparer for super-ko cases. There is no need for more than one instance of this.
public static SuperKoComparer SuperKoComparer
리턴 SuperKoComparer