C# 클래스 TicTacToeLib.TicTacToeGame

A simple game of Tic-Tac-Toe.
파일 보기 프로젝트 열기: tansey/sharpneat-tutorials 1 사용 예제들

공개 메소드들

메소드 설명
GetBoardFromString ( string boardString ) : ].SquareTypes[

Takes a string description of a game board and returns the board array. A valid board example is: X|O|X |X| O|X|O Note that there should be a space in blank squares.

GetRandomBoard ( int moves ) : ].SquareTypes[

Gets a random game board played for a specified number of moves.

GetWinner ( ) : SquareTypes

Gets the winner of the current game.

GetWinner ( SquareTypes Board ) : SquareTypes

Gets the winner based on the specified board.

IsEmpty ( int x, int y ) : bool

Checks if the square located at [x,y] on the game board is empty.

PlayGameToEnd ( IPlayer xPlayer, IPlayer oPlayer ) : SquareTypes

A helper method for competing two players against each other.

ResetGame ( ) : void

Resets the current game by clearing the game board.

TicTacToeGame ( ) : System

비공개 메소드들

메소드 설명
getSquareType ( string squareString ) : SquareTypes

메소드 상세

GetBoardFromString() 공개 정적인 메소드

Takes a string description of a game board and returns the board array. A valid board example is: X|O|X |X| O|X|O Note that there should be a space in blank squares.
public static GetBoardFromString ( string boardString ) : ].SquareTypes[
boardString string
리턴 ].SquareTypes[

GetRandomBoard() 공개 정적인 메소드

Gets a random game board played for a specified number of moves.
public static GetRandomBoard ( int moves ) : ].SquareTypes[
moves int
리턴 ].SquareTypes[

GetWinner() 공개 메소드

Gets the winner of the current game.
public GetWinner ( ) : SquareTypes
리턴 SquareTypes

GetWinner() 공개 정적인 메소드

Gets the winner based on the specified board.
public static GetWinner ( SquareTypes Board ) : SquareTypes
Board SquareTypes
리턴 SquareTypes

IsEmpty() 공개 메소드

Checks if the square located at [x,y] on the game board is empty.
public IsEmpty ( int x, int y ) : bool
x int
y int
리턴 bool

PlayGameToEnd() 공개 정적인 메소드

A helper method for competing two players against each other.
public static PlayGameToEnd ( IPlayer xPlayer, IPlayer oPlayer ) : SquareTypes
xPlayer IPlayer The player to act first.
oPlayer IPlayer The player to act second.
리턴 SquareTypes

ResetGame() 공개 메소드

Resets the current game by clearing the game board.
public ResetGame ( ) : void
리턴 void

TicTacToeGame() 공개 메소드

public TicTacToeGame ( ) : System
리턴 System