C# Class Reversi.ReversiBoard

Inheritance: System.Windows.Forms.PictureBox
Exibir arquivo Open project: ufcpp/UfcppSample Class Usage Examples

Public Methods

Method Description
Check ( int x, int y, ReversiColor color ) : bool

座標(x,y)にコマをおけるかどうかを調べる 調べる場所のx座標 0〜width-1 調べる場所のy座標 0〜width-1 置けるかどうか

CheckAll ( ReversiColor color ) : bool

盤面に置けるますがあるかどうかを調べる

Clone ( ) : ReversiBoard

自分自身のコピーを生成

CountUp ( int &black_num, int &white_num ) : void

駒の数を数える

GetScore ( ReversiColor color ) : int
InverseColor ( ReversiColor color ) : ReversiColor

駒の色と逆の色を返す

ReversiBoard ( ) : System

盤面の初期化 盤面のサイズはデフォルトでは8×8

ReversiBoard ( int width, int height ) : System

盤面の初期化 盤面の幅は自由に決めれる

this ( int x, int y ) : ReversiColor

set 盤面に新たに駒を置き、盤面の更新を行う get 盤面に置かれた駒の色を返す x : 0〜width-1 y : 0〜height-1

Protected Methods

Method Description
ReversiBoard ( ReversiBoard b ) : System

盤面のコピーを作成するコンストラクタ

Private Methods

Method Description
CheckLine ( int x, int y, int dx, int dy, ReversiColor color ) : bool

座標(x,y)にコマをおけるかどうか、1ライン分調べる (Checkメソッドで利用する) 調べる場所のx座標 調べる場所のy座標 置けるかどうか

UpdateLine ( int x, int y, int dx, int dy, ReversiColor color ) : void

盤面の更新を1ラインずつ行う 置く場所のx座標 置く場所のy座標 置く駒の色

Method Details

Check() public method

座標(x,y)にコマをおけるかどうかを調べる 調べる場所のx座標 0〜width-1 調べる場所のy座標 0〜width-1 置けるかどうか
public Check ( int x, int y, ReversiColor color ) : bool
x int
y int
color ReversiColor
return bool

CheckAll() public method

盤面に置けるますがあるかどうかを調べる
public CheckAll ( ReversiColor color ) : bool
color ReversiColor
return bool

Clone() public method

自分自身のコピーを生成
public Clone ( ) : ReversiBoard
return ReversiBoard

CountUp() public method

駒の数を数える
public CountUp ( int &black_num, int &white_num ) : void
black_num int 黒い駒の数を返す
white_num int 白い駒の数を返す
return void

GetScore() public method

public GetScore ( ReversiColor color ) : int
color ReversiColor
return int

InverseColor() static public method

駒の色と逆の色を返す
static public InverseColor ( ReversiColor color ) : ReversiColor
color ReversiColor 駒の色
return ReversiColor

ReversiBoard() public method

盤面の初期化 盤面のサイズはデフォルトでは8×8
public ReversiBoard ( ) : System
return System

ReversiBoard() protected method

盤面のコピーを作成するコンストラクタ
protected ReversiBoard ( ReversiBoard b ) : System
b ReversiBoard コピー元
return System

ReversiBoard() public method

盤面の初期化 盤面の幅は自由に決めれる
public ReversiBoard ( int width, int height ) : System
width int 盤面の幅
height int 盤面の高さ
return System

this() public method

set 盤面に新たに駒を置き、盤面の更新を行う get 盤面に置かれた駒の色を返す x : 0〜width-1 y : 0〜height-1
public this ( int x, int y ) : ReversiColor
x int
y int
return ReversiColor