C# Class ChessDotNet.ChessGame

Afficher le fichier Open project: ProgramFOX/Chess.NET Class Usage Examples

Protected Properties

Свойство Type Description
Board ChessDotNet.Piece[][]
checkmatedCacheBlack Cache
checkmatedCacheWhite Cache
fiftyMoves bool
inCheckCacheBlack Cache
inCheckCacheWhite Cache
stalematedCacheBlack Cache
stalematedCacheWhite Cache

Méthodes publiques

Méthode Description
ApplyMove ( Move move, bool alreadyValidated ) : MoveType
ChessGame ( ) : System
ChessGame ( GameCreationData data ) : System
ChessGame ( IEnumerable moves, bool movesAreValidated ) : System
ChessGame ( string fen ) : System
ClaimDraw ( string reason ) : void
GetBoard ( ) : ChessDotNet.Piece[][]
GetFen ( ) : string
GetPieceAt ( File file, int rank ) : Piece
GetPieceAt ( Position position ) : Piece
GetValidMoves ( Player player ) : ReadOnlyCollection
GetValidMoves ( Position from ) : ReadOnlyCollection
HasAnyValidMoves ( Player player ) : bool
HasAnyValidMoves ( Position from ) : bool
IsCheckmated ( Player player ) : bool
IsDraw ( ) : bool
IsInCheck ( Player player ) : bool
IsStalemated ( Player player ) : bool
IsValidMove ( Move move ) : bool
IsWinner ( Player player ) : bool
MapPgnCharToPiece ( char c, Player owner ) : Piece
Resign ( Player player ) : void
WouldBeInCheckAfter ( Move move, Player player ) : bool

Méthodes protégées

Méthode Description
ApplyCastle ( Move move ) : CastlingType
CloneBoard ( Piece originalBoard ) : ChessDotNet.Piece[][]
FenStringToGameCreationData ( string fen ) : GameCreationData
GetValidMoves ( Player player, bool returnIfAny ) : ReadOnlyCollection
GetValidMoves ( Position from, bool returnIfAny ) : ReadOnlyCollection
IsValidMove ( Move move, bool validateCheck ) : bool
IsValidMove ( Move move, bool validateCheck, bool careAboutWhoseTurnItIs ) : bool
SetPieceAt ( File file, int rank, Piece piece ) : void
UseGameCreationData ( GameCreationData data ) : void

Private Methods

Méthode Description
ChessGame ( Piece board, Player whoseTurn ) : System

Method Details

ApplyCastle() protected méthode

protected ApplyCastle ( Move move ) : CastlingType
move Move
Résultat CastlingType

ApplyMove() public méthode

public ApplyMove ( Move move, bool alreadyValidated ) : MoveType
move Move
alreadyValidated bool
Résultat MoveType

ChessGame() public méthode

public ChessGame ( ) : System
Résultat System

ChessGame() public méthode

public ChessGame ( GameCreationData data ) : System
data GameCreationData
Résultat System

ChessGame() public méthode

public ChessGame ( IEnumerable moves, bool movesAreValidated ) : System
moves IEnumerable
movesAreValidated bool
Résultat System

ChessGame() public méthode

public ChessGame ( string fen ) : System
fen string
Résultat System

ClaimDraw() public méthode

public ClaimDraw ( string reason ) : void
reason string
Résultat void

CloneBoard() protected static méthode

protected static CloneBoard ( Piece originalBoard ) : ChessDotNet.Piece[][]
originalBoard Piece
Résultat ChessDotNet.Piece[][]

FenStringToGameCreationData() protected méthode

protected FenStringToGameCreationData ( string fen ) : GameCreationData
fen string
Résultat GameCreationData

GetBoard() public méthode

public GetBoard ( ) : ChessDotNet.Piece[][]
Résultat ChessDotNet.Piece[][]

GetFen() public méthode

public GetFen ( ) : string
Résultat string

GetPieceAt() public méthode

public GetPieceAt ( File file, int rank ) : Piece
file File
rank int
Résultat Piece

GetPieceAt() public méthode

public GetPieceAt ( Position position ) : Piece
position Position
Résultat Piece

GetValidMoves() public méthode

public GetValidMoves ( Player player ) : ReadOnlyCollection
player Player
Résultat ReadOnlyCollection

GetValidMoves() protected méthode

protected GetValidMoves ( Player player, bool returnIfAny ) : ReadOnlyCollection
player Player
returnIfAny bool
Résultat ReadOnlyCollection

GetValidMoves() public méthode

public GetValidMoves ( Position from ) : ReadOnlyCollection
from Position
Résultat ReadOnlyCollection

GetValidMoves() protected méthode

protected GetValidMoves ( Position from, bool returnIfAny ) : ReadOnlyCollection
from Position
returnIfAny bool
Résultat ReadOnlyCollection

HasAnyValidMoves() public méthode

public HasAnyValidMoves ( Player player ) : bool
player Player
Résultat bool

HasAnyValidMoves() public méthode

public HasAnyValidMoves ( Position from ) : bool
from Position
Résultat bool

IsCheckmated() public méthode

public IsCheckmated ( Player player ) : bool
player Player
Résultat bool

IsDraw() public méthode

public IsDraw ( ) : bool
Résultat bool

IsInCheck() public méthode

public IsInCheck ( Player player ) : bool
player Player
Résultat bool

IsStalemated() public méthode

public IsStalemated ( Player player ) : bool
player Player
Résultat bool

IsValidMove() public méthode

public IsValidMove ( Move move ) : bool
move Move
Résultat bool

IsValidMove() protected méthode

protected IsValidMove ( Move move, bool validateCheck ) : bool
move Move
validateCheck bool
Résultat bool

IsValidMove() protected méthode

protected IsValidMove ( Move move, bool validateCheck, bool careAboutWhoseTurnItIs ) : bool
move Move
validateCheck bool
careAboutWhoseTurnItIs bool
Résultat bool

IsWinner() public méthode

public IsWinner ( Player player ) : bool
player Player
Résultat bool

MapPgnCharToPiece() public méthode

public MapPgnCharToPiece ( char c, Player owner ) : Piece
c char
owner Player
Résultat Piece

Resign() public méthode

public Resign ( Player player ) : void
player Player
Résultat void

SetPieceAt() protected méthode

protected SetPieceAt ( File file, int rank, Piece piece ) : void
file File
rank int
piece Piece
Résultat void

UseGameCreationData() protected méthode

protected UseGameCreationData ( GameCreationData data ) : void
data GameCreationData
Résultat void

WouldBeInCheckAfter() public méthode

public WouldBeInCheckAfter ( Move move, Player player ) : bool
move Move
player Player
Résultat bool

Property Details

Board protected_oe property

protected Piece[][],ChessDotNet Board
Résultat ChessDotNet.Piece[][]

checkmatedCacheBlack protected_oe property

protected Cache checkmatedCacheBlack
Résultat Cache

checkmatedCacheWhite protected_oe property

protected Cache checkmatedCacheWhite
Résultat Cache

fiftyMoves protected_oe property

protected bool fiftyMoves
Résultat bool

inCheckCacheBlack protected_oe property

protected Cache inCheckCacheBlack
Résultat Cache

inCheckCacheWhite protected_oe property

protected Cache inCheckCacheWhite
Résultat Cache

stalematedCacheBlack protected_oe property

protected Cache stalematedCacheBlack
Résultat Cache

stalematedCacheWhite protected_oe property

protected Cache stalematedCacheWhite
Résultat Cache