Belofte version 2.2.0
A promising chess program using the UCI or Winboard interface
bPieceColour Class Referenceabstract

#include <piece.h>

+ Inheritance diagram for bPieceColour:

Public Member Functions

 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
 
virtual bool isAttacked (bBasicBoard const &b, case_t const &cf) const
 
side_t invert ()
 
virtual bool canMovePreflightCheck (bBasicBoard &b, case_t const &cf, case_t const &ct) const =0
 
virtual bool canMovePreflightCheck (bBasicBoard &b, case_t const &cf, int8_t const ri, int8_t const ci) const =0
 
virtual movenum_t addMove (bBasicBoard const &b, case_t const &cf, case_t const &ct, bMoveList &ml) const =0
 
virtual movenum_t addMoves (bBasicBoard const &b, case_t const &cf, int8_t const ri, int8_t const ci, bMoveList &ml) const =0
 

Static Protected Member Functions

static 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)
 Class static function Return true if position is attacked by opponent respecting move offsets.
 

Protected Attributes

side_t m_side = tSide::SIDE_UNDEFINED
 

Detailed Description

Definition at line 138 of file piece.h.

Constructor & Destructor Documentation

◆ bPieceColour() [1/3]

bPieceColour::bPieceColour ( side_t s)
inlineexplicit

Definition at line 140 of file piece.h.

Referenced by bBlackPiece::bBlackPiece(), bEmptyPiece::bEmptyPiece(), bPieceColour(), bPieceColour(), bWhitePiece::bWhitePiece(), operator=(), and operator=().

+ Here is the caller graph for this function:

◆ ~bPieceColour()

virtual bPieceColour::~bPieceColour ( )
inlinevirtual

Definition at line 143 of file piece.h.

◆ bPieceColour() [2/3]

bPieceColour::bPieceColour ( bPieceColour const & )
delete
+ Here is the call graph for this function:

◆ bPieceColour() [3/3]

bPieceColour::bPieceColour ( bPieceColour && )
delete
+ Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

bPieceColour & bPieceColour::operator= ( bPieceColour const & )
delete
+ Here is the call graph for this function:

◆ operator=() [2/2]

bPieceColour & bPieceColour::operator= ( bPieceColour && )
delete
+ Here is the call graph for this function:

◆ isWhite()

bool bPieceColour::isWhite ( ) const
inlineconstexpr

Definition at line 152 of file piece.h.

Referenced by invert(), and opponent().

+ Here is the caller graph for this function:

◆ isBlack()

bool bPieceColour::isBlack ( ) const
inlineconstexpr

Definition at line 154 of file piece.h.

Referenced by toMove().

+ Here is the caller graph for this function:

◆ isEmpty()

bool bPieceColour::isEmpty ( ) const
inlineconstexpr

Definition at line 156 of file piece.h.

◆ opponent()

side_t bPieceColour::opponent ( ) const
inlineconstexpr

Definition at line 158 of file piece.h.

+ Here is the call graph for this function:

◆ toMove()

side_t bPieceColour::toMove ( ) const
inlineconstexpr

Definition at line 160 of file piece.h.

+ Here is the call graph for this function:

◆ isAttacked()

virtual bool bPieceColour::isAttacked ( bBasicBoard const & b,
case_t const & cf ) const
inlinevirtual

Reimplemented in bBlackPiece, bEmptyPiece, and bWhitePiece.

Definition at line 163 of file piece.h.

◆ invert()

side_t bPieceColour::invert ( )
inline

Definition at line 165 of file piece.h.

+ Here is the call graph for this function:

◆ canMovePreflightCheck() [1/2]

virtual bool bPieceColour::canMovePreflightCheck ( bBasicBoard & b,
case_t const & cf,
case_t const & ct ) const
pure virtual

Implemented in bBlackPiece, bEmptyPiece, and bWhitePiece.

◆ canMovePreflightCheck() [2/2]

virtual bool bPieceColour::canMovePreflightCheck ( bBasicBoard & b,
case_t const & cf,
int8_t const ri,
int8_t const ci ) const
pure virtual

◆ addMove()

virtual movenum_t bPieceColour::addMove ( bBasicBoard const & b,
case_t const & cf,
case_t const & ct,
bMoveList & ml ) const
pure virtual

Implemented in bBlackPiece, bEmptyPiece, and bWhitePiece.

◆ addMoves()

virtual movenum_t bPieceColour::addMoves ( bBasicBoard const & b,
case_t const & cf,
int8_t const ri,
int8_t const ci,
bMoveList & ml ) const
pure virtual

Implemented in bBlackPiece, bEmptyPiece, and bWhitePiece.

◆ isAttackedBySlider()

bool bPieceColour::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 )
staticprotected

Class static function Return true if position is attacked by opponent respecting move offsets.

Parameters
bboard
cffrom field
fromcolfield from
fromrankfield from
cicol increment
rirow increment
cPiecefirst possible piece (rook/bishop)
cPiece2second possible piece (queen)
Returns
true/false

Definition at line 350 of file piece.cpp.

Referenced by bBlackPiece::isAttacked(), and bWhitePiece::isAttacked().

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

Member Data Documentation

◆ m_side

side_t bPieceColour::m_side = tSide::SIDE_UNDEFINED
protected

Definition at line 186 of file piece.h.

Referenced by bPieceColour(), invert(), isBlack(), isEmpty(), and isWhite().