Belofte version 2.2.0
A promising chess program using the UCI or Winboard interface
bBlackPawn Class Reference

#include <piece.h>

+ Inheritance diagram for bBlackPawn:
+ Collaboration diagram for bBlackPawn:

Public Member Functions

 bBlackPawn ()
 
 ~bBlackPawn () override
 
bool canMovePreflightCheck (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 hasValidMovePreflightCheck (bBasicBoard &b, case_t const &cf) override
 check if there is at least one move possible currently, relies on full move generation for pawn
 
movenum_t GenerateMoves (bBasicBoard const &b, case_t const &cf, bMoveList &ml) override
 
- Public Member Functions inherited from bPawn
 bPawn (piece_t p)
 
 ~bPawn () override
 
- Public Member Functions inherited from bPiece
 bPiece ()
 
 bPiece (bPiece &&bp)
 
 bPiece (piece_t piece)
 
virtual ~bPiece ()
 
 bPiece (bPiece const &)=delete
 
bPieceoperator= (bPiece const &)=delete
 
bPieceoperator= (bPiece &&)=delete
 
constexpr piece_t getPiece () const
 
side_t toMove () const
 
- Public Member Functions inherited from bBlackPiece
 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) 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 ()
 

Static Protected Member Functions

static movenum_t addNonCapturePawnMove (bBasicBoard const &b, case_t const &cf, bMoveList &ml)
 Class static function Test move is possible, single step move non capture move.
 
static movenum_t addEPMove (bBasicBoard const &b, case_t const &cf, int8_t const ci, bMoveList &ml)
 Test move is possible, e.p.
 
static movenum_t addCapturePawnMove (bBasicBoard const &b, case_t const &cf, int8_t const ci, bMoveList &ml)
 
static movenum_t addNonCapturePromotionMove (bBasicBoard const &b, case_t const &cf, bMoveList &ml)
 
static movenum_t addCapturePromotionMove (bBasicBoard const &b, case_t const &cf, int8_t const ci, bMoveList &ml)
 
- Static Protected Member Functions inherited from bPieceColour
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from bPiece
static piece_t getPiece (cpiece_t const piece)
 static class member function
 
static cpiece_t getPieceChar (piece_t const piece)
 static class member function
 
static bPiecegetPieceClass (piece_t const piece)
 static class member function
 
static std::string getPieceStrUpper (piece_t const piece)
 static class member function
 
static bool isOpponent (side_t const s, piece_t const piece)
 static class member function
 
static bool isOwnColour (side_t const s, piece_t const piece)
 static class member function
 
static bool isWhitePiece (piece_t const p)
 static class member function
 
static bool isBlackPiece (piece_t const p)
 static class member function
 
- Protected Attributes inherited from bPieceColour
side_t m_side = tSide::SIDE_UNDEFINED
 

Detailed Description

Definition at line 323 of file piece.h.

Constructor & Destructor Documentation

◆ bBlackPawn()

bBlackPawn::bBlackPawn ( )
inlineexplicit

Definition at line 325 of file piece.h.

+ Here is the call graph for this function:

◆ ~bBlackPawn()

bBlackPawn::~bBlackPawn ( )
inlineoverride

Definition at line 328 of file piece.h.

Member Function Documentation

◆ canMovePreflightCheck()

bool bBlackPawn::canMovePreflightCheck ( 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 524 of file piece.cpp.

+ Here is the call graph for this function:

◆ hasValidMovePreflightCheck()

bool bBlackPawn::hasValidMovePreflightCheck ( bBasicBoard & b,
case_t const & cf )
overridevirtual

check if there is at least one move possible currently, relies on full move generation for pawn

Implements bPiece.

Definition at line 977 of file piece.cpp.

+ Here is the call graph for this function:

◆ GenerateMoves()

movenum_t bBlackPawn::GenerateMoves ( bBasicBoard const & b,
case_t const & cf,
bMoveList & ml )
overridevirtual

Implements bPiece.

Definition at line 989 of file piece.cpp.

+ Here is the call graph for this function:

◆ addNonCapturePawnMove()

movenum_t bBlackPawn::addNonCapturePawnMove ( bBasicBoard const & b,
case_t const & cf,
bMoveList & ml )
staticprotected

Class static function Test move is possible, single step move non capture move.

Definition at line 773 of file piece.cpp.

Referenced by GenerateMoves().

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

◆ addEPMove()

movenum_t bBlackPawn::addEPMove ( bBasicBoard const & b,
case_t const & cf,
int8_t const ci,
bMoveList & ml )
staticprotected

Test move is possible, e.p.

move capture only move, no test if pawn is present only board e.p. flag is used in calling function

Definition at line 919 of file piece.cpp.

Referenced by GenerateMoves().

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

◆ addCapturePawnMove()

movenum_t bBlackPawn::addCapturePawnMove ( bBasicBoard const & b,
case_t const & cf,
int8_t const ci,
bMoveList & ml )
staticprotected

Definition at line 811 of file piece.cpp.

Referenced by GenerateMoves().

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

◆ addNonCapturePromotionMove()

movenum_t bBlackPawn::addNonCapturePromotionMove ( bBasicBoard const & b,
case_t const & cf,
bMoveList & ml )
staticprotected

Definition at line 845 of file piece.cpp.

Referenced by GenerateMoves().

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

◆ addCapturePromotionMove()

movenum_t bBlackPawn::addCapturePromotionMove ( bBasicBoard const & b,
case_t const & cf,
int8_t const ci,
bMoveList & ml )
staticprotected

Definition at line 879 of file piece.cpp.

Referenced by GenerateMoves().

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