C# 클래스 ReversiEight.ViewModel.GameBoardViewModel

A view model that encapsulates the logic of the game of Reversi
상속: ViewModelBase
파일 보기 프로젝트 열기: ColinEberhardt/ReversiEight 1 사용 예제들

공개 메소드들

메소드 설명
GameBoardViewModel ( GameBoardViewModel copy ) : System
IsValidMove ( int row, int col ) : bool

Determines whether the given move is valid for the next turn

IsValidMove ( int row, int col, BoardSquareState state ) : bool

Determines whether the given move is valid

MakeMove ( int row, int col ) : void

Makes the given move for the current player. Score are updated and play then moves to the next player.

비공개 메소드들

메소드 설명
CanPlayerMakeAMove ( BoardSquareState state ) : bool

Determines whether there are any valid moves that the given player can make.

FlipOpponentsCounters ( int row, int column, BoardSquareState state ) : void

Flips all the opponents pieces that are surrounded by the given move.

GameBoardViewModel ( ) : System
GetSquare ( int row, int col ) : GameBoardSquareViewModel
HasGameFinished ( ) : bool
InitialiseGame ( ) : void

Sets up the view model to the initial game state.

InvertState ( BoardSquareState state ) : BoardSquareState
MoveSurroundsCounters ( int row, int column, NavigationFunction navigationFunction, BoardSquareState state ) : bool

Determines whether the given move 'surrounds' any of the opponents pieces.

NavigateBoard ( NavigationFunction navigationFunction, int row, int column ) : IEnumerable

A list of board squares that are yielded via the given navigation function.

메소드 상세

GameBoardViewModel() 공개 메소드

public GameBoardViewModel ( GameBoardViewModel copy ) : System
copy GameBoardViewModel
리턴 System

IsValidMove() 공개 메소드

Determines whether the given move is valid for the next turn
public IsValidMove ( int row, int col ) : bool
row int
col int
리턴 bool

IsValidMove() 공개 메소드

Determines whether the given move is valid
public IsValidMove ( int row, int col, BoardSquareState state ) : bool
row int
col int
state BoardSquareState
리턴 bool

MakeMove() 공개 메소드

Makes the given move for the current player. Score are updated and play then moves to the next player.
public MakeMove ( int row, int col ) : void
row int
col int
리턴 void