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

Public Member Functions

 bPieceColour (side_t s)
 
virtual ~bPieceColour ()
 
 bPieceColour (bPieceColour const &)=delete
 
 bPieceColour (bPieceColour &&)=delete
 
bPieceColouroperator= (bPieceColour const &)=delete
 
bPieceColouroperator= (bPieceColour &&)=delete
 
bool isWhite () const
 
bool isBlack () const
 
bool isEmpty () const
 
side_t invert ()
 
side_t opponent () const
 
side_t toMove () const
 
virtual bool isAttacked (bBoard const &b, case_t const &cf) const =0
 

Protected Member Functions

bool isAttackedByPiece (bBoard const &b, case_t const &cf, piece_t const cPiece, int8_t const ri, int8_t const ci) const
 Return true if position is attacked by opponent respecting move offsets. More...
 
bool isAttackedBySlider (bBoard const &b, case_t const &cf, piece_t const cPiece, piece_t const cPiece2, int8_t const ri, int8_t const ci) const
 Return true if position is attacked by opponent respecting move offsets. More...
 

Protected Attributes

side_t m_side = tSide::SIDE_UNDEFINED
 

Detailed Description

Definition at line 135 of file piece.h.

Constructor & Destructor Documentation

◆ bPieceColour() [1/3]

bPieceColour::bPieceColour ( side_t  s)

Definition at line 162 of file piece.cpp.

◆ ~bPieceColour()

bPieceColour::~bPieceColour ( )
virtual

Definition at line 167 of file piece.cpp.

◆ bPieceColour() [2/3]

bPieceColour::bPieceColour ( bPieceColour const &  )
delete

◆ bPieceColour() [3/3]

bPieceColour::bPieceColour ( bPieceColour &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

bPieceColour& bPieceColour::operator= ( bPieceColour const &  )
delete

◆ operator=() [2/2]

bPieceColour& bPieceColour::operator= ( bPieceColour &&  )
delete

◆ isWhite()

bool bPieceColour::isWhite ( ) const
inline

Definition at line 146 of file piece.h.

Referenced by invert(), and opponent().

+ Here is the caller graph for this function:

◆ isBlack()

bool bPieceColour::isBlack ( ) const
inline

Definition at line 147 of file piece.h.

Referenced by toMove().

+ Here is the caller graph for this function:

◆ isEmpty()

bool bPieceColour::isEmpty ( ) const
inline

Definition at line 148 of file piece.h.

◆ invert()

side_t bPieceColour::invert ( )
inline

Definition at line 150 of file piece.h.

+ Here is the call graph for this function:

◆ opponent()

side_t bPieceColour::opponent ( ) const
inline

Definition at line 154 of file piece.h.

+ Here is the call graph for this function:

◆ toMove()

side_t bPieceColour::toMove ( ) const
inline

Definition at line 157 of file piece.h.

+ Here is the call graph for this function:

◆ isAttacked()

virtual bool bPieceColour::isAttacked ( bBoard const &  b,
case_t const &  cf 
) const
pure virtual

Implemented in bBlackPiece, and bWhitePiece.

◆ isAttackedByPiece()

bool bPieceColour::isAttackedByPiece ( bBoard const &  b,
case_t const &  cf,
piece_t const  cPiece,
int8_t const  ri,
int8_t const  ci 
) const
protected

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

Parameters
bboard
cffield from
cPieceattacking piece
rirow increment
cicol increment
Returns
true/false

Definition at line 291 of file piece.cpp.

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

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

◆ isAttackedBySlider()

bool bPieceColour::isAttackedBySlider ( bBoard const &  b,
case_t const &  cf,
piece_t const  cPiece,
piece_t const  cPiece2,
int8_t const  ri,
int8_t const  ci 
) const
protected

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

Parameters
bboard
cffield from
cPiecefirst possible piece (rook/bishop)
cPiece2second possible piece (queen)
rirow increment
cicol increment
Returns
true/false

Definition at line 307 of file piece.cpp.

Referenced by bWhitePiece::isAttacked(), and bBlackPiece::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 170 of file piece.h.

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