C# Class Chess.Data.Entities.ChessPiece

Inheritance: IPiece, IModifiable
Show file Open project: colin-higgins/ChessSharp Class Usage Examples

Private Properties

Property Type Description
DestroyOccupant void

Public Methods

Method Description
GetPieceType ( ) : PieceType
GetValidMoves ( Square board ) : IEnumerable
IsLegalMove ( Square board, Move move, IEnumerable pastMoves = null ) : bool
Move ( Square board, Move move ) : void

Protected Methods

Method Description
GetAttacker ( Square board, Move move ) : ChessPiece
GetDestinationPiece ( Square board, Move move ) : ChessPiece
GetDiagonalMoves ( Square board, int row, int column, int>.List endPositions ) : void
GetHorizontalMoves ( Square board, int row, int column, int>.List endPositions ) : void
GetMovementModifier ( int change ) : int
GetOppositeTeam ( ) : Team
GetVerticalMoves ( Square board, int column, int row, int>.List endPositions ) : void
HasCollision ( Square board, Move move ) : bool
InBounds ( int row, int column ) : bool
LegalDirectionByTeam ( ) : int
SetupNewMove ( int row, int column ) : Move
ValidateNotAttackingSameTeam ( Square board, Move move ) : void

Private Methods

Method Description
DestroyOccupant ( Square board, Move move ) : void

Method Details

GetAttacker() protected method

protected GetAttacker ( Square board, Move move ) : ChessPiece
board Square
move Move
return ChessPiece

GetDestinationPiece() protected method

protected GetDestinationPiece ( Square board, Move move ) : ChessPiece
board Square
move Move
return ChessPiece

GetDiagonalMoves() protected method

protected GetDiagonalMoves ( Square board, int row, int column, int>.List endPositions ) : void
board Square
row int
column int
endPositions int>.List
return void

GetHorizontalMoves() protected method

protected GetHorizontalMoves ( Square board, int row, int column, int>.List endPositions ) : void
board Square
row int
column int
endPositions int>.List
return void

GetMovementModifier() protected method

protected GetMovementModifier ( int change ) : int
change int
return int

GetOppositeTeam() protected method

protected GetOppositeTeam ( ) : Team
return Team

GetPieceType() public method

public GetPieceType ( ) : PieceType
return PieceType

GetValidMoves() public abstract method

public abstract GetValidMoves ( Square board ) : IEnumerable
board Square
return IEnumerable

GetVerticalMoves() protected method

protected GetVerticalMoves ( Square board, int column, int row, int>.List endPositions ) : void
board Square
column int
row int
endPositions int>.List
return void

HasCollision() protected method

protected HasCollision ( Square board, Move move ) : bool
board Square
move Move
return bool

InBounds() protected method

protected InBounds ( int row, int column ) : bool
row int
column int
return bool

IsLegalMove() public abstract method

public abstract IsLegalMove ( Square board, Move move, IEnumerable pastMoves = null ) : bool
board Square
move Move
pastMoves IEnumerable
return bool

LegalDirectionByTeam() protected method

protected LegalDirectionByTeam ( ) : int
return int

Move() public method

public Move ( Square board, Move move ) : void
board Square
move Move
return void

SetupNewMove() protected method

protected SetupNewMove ( int row, int column ) : Move
row int
column int
return Move

ValidateNotAttackingSameTeam() protected method

protected ValidateNotAttackingSameTeam ( Square board, Move move ) : void
board Square
move Move
return void