Belofte version 2.1.9
A promising chess program using the UCI or Winboard interface
bBlackPiece Class Reference

#include <piece.h>

+ Inheritance diagram for bBlackPiece:
+ Collaboration diagram for bBlackPiece:

Public Member Functions

 bBlackPiece ()
 
 ~bBlackPiece () override
 
bool canMovePreflightCheck (bBasicBoard &b, case_t const &cf, case_t const &ct) const override
 Check if any could be added by just checking there.
 
bool canMovePreflightCheck (bBasicBoard &b, case_t const &cf, int8_t const ri, int8_t const ci, uint_fast8_t nMax=1) const override
 Check if pawn move could be added by just checking there is not check, case of possible promotion.
 
bool canPawnMovePreflightCheck (bBasicBoard &b, case_t const &cf, int8_t const ri, int8_t const ci) const override
 Check if pawn move could be added by just checking there is not check, case of possible promotion.
 
bool isAttacked (bBasicBoard const &b, case_t const &cf) const override
 
movenum_t addMove (bBasicBoard const &b, case_t const &cf, case_t const &ct, bMoveList &ml) const override
 
movenum_t addMoves (bBasicBoard const &b, case_t const &cf, int8_t const ri, int8_t const ci, bMoveList &ml) const override
 
- Public Member Functions inherited from bPieceColour
 bPieceColour (side_t s)
 
virtual ~bPieceColour ()
 
 bPieceColour (bPieceColour const &)=delete
 
 bPieceColour (bPieceColour &&)=delete
 
bPieceColouroperator= (bPieceColour const &)=delete
 
bPieceColouroperator= (bPieceColour &&)=delete
 
constexpr bool isWhite () const
 
constexpr bool isBlack () const
 
constexpr bool isEmpty () const
 
constexpr side_t opponent () const
 
constexpr side_t toMove () const
 
side_t invert ()
 

Additional Inherited Members

- Protected Member Functions inherited from bPieceColour
bool isAttackedBySlider (bBasicBoard const &b, case_t cf, column_t fromcol, rank_t fromrank, int8_t const ci, int8_t const ri, piece_t const cPiece, piece_t const cPiece2) const
 Return true if position is attacked by opponent respecting move offsets.
 
- Protected Attributes inherited from bPieceColour
side_t m_side = tSide::SIDE_UNDEFINED
 

Detailed Description

Definition at line 221 of file piece.h.

Constructor & Destructor Documentation

◆ bBlackPiece()

bBlackPiece::bBlackPiece ( )
inline

Definition at line 223 of file piece.h.

+ Here is the call graph for this function:

◆ ~bBlackPiece()

bBlackPiece::~bBlackPiece ( )
inlineoverride

Definition at line 226 of file piece.h.

Member Function Documentation

◆ canMovePreflightCheck() [1/2]

bool bBlackPiece::canMovePreflightCheck ( bBasicBoard & b,
case_t const & cf,
case_t const & ct ) const
overridevirtual

Check if any could be added by just checking there.

Returns
true if move seems valid, false if in check after move

Implements bPieceColour.

Definition at line 467 of file piece.cpp.

Referenced by bBlackBishop::hasValidMovePreflightCheck(), bBlackKing::hasValidMovePreflightCheck(), bBlackKnight::hasValidMovePreflightCheck(), bBlackQueen::hasValidMovePreflightCheck(), and bBlackRook::hasValidMovePreflightCheck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ canMovePreflightCheck() [2/2]

bool bBlackPiece::canMovePreflightCheck ( bBasicBoard & b,
case_t const & cf,
int8_t const ri,
int8_t const ci,
uint_fast8_t nMax = 1 ) const
overridevirtual

Check if pawn move could be added by just checking there is not check, case of possible promotion.

Returns
true if move seems valid, false if in check after move

Implements bPieceColour.

Definition at line 489 of file piece.cpp.

+ Here is the call graph for this function:

◆ canPawnMovePreflightCheck()

bool bBlackPiece::canPawnMovePreflightCheck ( bBasicBoard & b,
case_t const & cf,
int8_t const ri,
int8_t const ci ) const
overridevirtual

Check if pawn move could be added by just checking there is not check, case of possible promotion.

Returns
true if move seems valid, false if in check after move

Implements bPieceColour.

Definition at line 525 of file piece.cpp.

+ Here is the call graph for this function:

◆ isAttacked()

bool bBlackPiece::isAttacked ( bBasicBoard const & b,
case_t const & cf ) const
overridevirtual

Reimplemented from bPieceColour.

Definition at line 303 of file piece.cpp.

Referenced by canMovePreflightCheck(), canMovePreflightCheck(), canPawnMovePreflightCheck(), and bBlackKing::GenerateMoves().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addMove()

movenum_t bBlackPiece::addMove ( bBasicBoard const & b,
case_t const & cf,
case_t const & ct,
bMoveList & ml ) const
overridevirtual

Implements bPieceColour.

Definition at line 567 of file piece.cpp.

Referenced by bBlackKing::GenerateMoves(), and bBlackKnight::GenerateMoves().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addMoves()

movenum_t bBlackPiece::addMoves ( bBasicBoard const & b,
case_t const & cf,
int8_t const ri,
int8_t const ci,
bMoveList & ml ) const
overridevirtual

Implements bPieceColour.

Definition at line 618 of file piece.cpp.

Referenced by bBlackBishop::GenerateMoves(), bBlackQueen::GenerateMoves(), and bBlackRook::GenerateMoves().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: