Belofte  version 2.1.5
A promising chess program using the UCI or Winboard interface
bKing Class Reference

Public Member Functions

 bKing (piece_t p)
 
int GenerateMoves (bBoard const &b, case_t const &cf, bMoveList &ml, side_t const side) override
 
- Public Member Functions inherited from bPiece
 bPiece ()
 
 bPiece (piece_t p)
 
virtual ~bPiece ()
 
 bPiece (bPiece &&)=default
 
 bPiece (bPiece const &)=delete
 
bPieceoperator= (bPiece const &)=delete
 
bPieceoperator= (bPiece &&)=delete
 
piece_t getPiece () const
 
virtual int GenerateMoves (bBoard const &b UNUSED, case_t const &cf UNUSED, bMoveList &ml UNUSED, side_t const side UNUSED)=0
 
int addMove (bBoard const &b, case_t const &cf, side_t const side, int8_t const ri, int8_t const ci, bMoveList &ml) const
 Check for in-check position, single step move used for King and Knight. More...
 
int addMoves (bBoard const &b, case_t const &cf, side_t const side, int nMax, int8_t const ri, int8_t const ci, bMoveList &ml) const
 Add moves for Queen, Rook and Bishop. More...
 
side_t toMove () const
 

Protected Member Functions

bool kingSeesRook (bBoard const &b, case_t const &cf, piece_t const cPiece, int8_t const ci) const
 Return true if king sees rook of own colour. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from bPiece
static piece_t getPiece (cpiece_t const p)
 static class member function More...
 
static cpiece_t getPieceChar (piece_t const p)
 static class member function More...
 
static bPiecegetPieceClass (piece_t const piece)
 static class member function More...
 
static const std::string getPieceStrUpper (piece_t const piece)
 static class member function More...
 
static bool isOpponent (side_t const s, piece_t const p)
 static class member function More...
 
static bool isOwnColour (side_t const s, piece_t const p)
 static class member function More...
 

Detailed Description

Definition at line 317 of file piece.h.

Constructor & Destructor Documentation

◆ bKing()

bKing::bKing ( piece_t  p)
inlineexplicit

Definition at line 319 of file piece.h.

Member Function Documentation

◆ GenerateMoves()

int bKing::GenerateMoves ( bBoard const &  b,
case_t const &  cf,
bMoveList ml,
side_t const  side 
)
override

Definition at line 633 of file piece.cpp.

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

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

◆ kingSeesRook()

bool bKing::kingSeesRook ( bBoard const &  b,
case_t const &  cf,
piece_t const  cPiece,
int8_t const  ci 
) const
protected

Return true if king sees rook of own colour.

Parameters
bboard
cffield from
cPiecerook
cicol increment
Returns
true/false

Definition at line 340 of file piece.cpp.

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

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