C# Класс Go.Game

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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