Belofte version 2.1.8
A promising chess program using the UCI or Winboard interface
bBlackPawn Class Referencefinal

#include <piece.h>

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

Public Member Functions

 bBlackPawn ()
 
bool hasValidMovePreflightCheck (bBoard &b, case_t const &cf) final
 check if there is at least one move possible currently, relies on full move generation for pawn
 
movenum_t GenerateMoves (bBoard const &b, case_t const &cf, bMoveList &ml) final
 
- Public Member Functions inherited from bPawn
 bPawn (piece_t p)
 
- 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 bool hasValidMovePreflightCheck (bBoard &b UNUSED, case_t const &cf UNUSED)=0
 
virtual movenum_t GenerateMoves (bBoard const &b UNUSED, case_t const &cf UNUSED, bMoveList &ml UNUSED)=0
 
side_t toMove () const
 
- Public Member Functions inherited from bBlackPiece
 bBlackPiece ()
 
 ~bBlackPiece () override
 
bool canMovePreflightCheck (bBoard &b, case_t const &cf, int8_t const ri, int8_t const ci) const override
 Check if move could be added by just checking there is not check.
 
bool canMovePreflightCheck (bBoard &b, case_t const &cf, int8_t const ri, int8_t const ci, piece_t const cPromotion) const override
 Check if pawn move could be added by just checking there is not check, case of possible promotion.
 
bool isAttacked (bBoard const &b, case_t const &cf) const override
 
movenum_t addMove (bBoard const &b, case_t const &cf, int8_t const ri, int8_t const ci, bMoveList &ml) const final
 
movenum_t addMoves (bBoard const &b, case_t const &cf, int8_t const ri, int8_t const ci, bMoveList &ml) const final
 
- 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
 
bool isWhite () const
 
bool isBlack () const
 
bool isEmpty () const
 
side_t invert ()
 
side_t opponent () const
 
side_t toMove () const
 

Protected Member Functions

movenum_t addNonCapturePawnMove (bBoard const &b, case_t const &cf, bMoveList &ml) const
 Test move is possible, single step move non capture move.
 
movenum_t addNonCaptureDoublePawnMove (bBoard const &b, case_t const &cf, bMoveList &ml) const
 
movenum_t addEPMove (bBoard const &b, case_t const &cf, int8_t const ci, bMoveList &ml) const
 Test move is possible, e.p.
 
movenum_t addCapturePawnMove (bBoard const &b, case_t const &cf, int8_t const ci, bMoveList &ml) const
 
movenum_t addNonCapturePromotionMove (bBoard const &b, case_t const &cf, bMoveList &ml) const
 
movenum_t addCapturePromotionMove (bBoard const &b, case_t const &cf, int8_t const ci, bMoveList &ml) const
 
- Protected Member Functions inherited from bPieceColour
bool isAttackedByPiece (bBoard const &b, column_t const fromcol, rank_t const fromrank, piece_t const cPiece, int8_t const ri, int8_t const ci) const
 Return true if position is attacked by opponent respecting move offsets.
 
bool isAttackedBySlider (bBoard const &b, column_t const fromcol, rank_t const fromrank, 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from bPiece
static piece_t getPiece (cpiece_t const p)
 static class member function
 
static cpiece_t getPieceChar (piece_t const p)
 static class member function
 
static bPiecegetPieceClass (piece_t const piece)
 static class member function
 
static const std::string getPieceStrUpper (piece_t const piece)
 static class member function
 
static bool isOpponent (side_t const s, piece_t const p)
 static class member function
 
static bool isOwnColour (side_t const s, piece_t const p)
 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 294 of file piece.h.

Constructor & Destructor Documentation

◆ bBlackPawn()

bBlackPawn::bBlackPawn ( )
inline

Definition at line 296 of file piece.h.

Member Function Documentation

◆ hasValidMovePreflightCheck()

bool bBlackPawn::hasValidMovePreflightCheck ( bBoard b,
case_t const &  cf 
)
final

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

Definition at line 950 of file piece.cpp.

+ Here is the call graph for this function:

◆ GenerateMoves()

movenum_t bBlackPawn::GenerateMoves ( bBoard const &  b,
case_t const &  cf,
bMoveList ml 
)
final

Definition at line 962 of file piece.cpp.

+ Here is the call graph for this function:

◆ addNonCapturePawnMove()

movenum_t bBlackPawn::addNonCapturePawnMove ( bBoard const &  b,
case_t const &  cf,
bMoveList ml 
) const
protected

Test move is possible, single step move non capture move.

Definition at line 742 of file piece.cpp.

Referenced by GenerateMoves().

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

◆ addNonCaptureDoublePawnMove()

movenum_t bBlackPawn::addNonCaptureDoublePawnMove ( bBoard const &  b,
case_t const &  cf,
bMoveList ml 
) const
protected

Definition at line 767 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 ( bBoard const &  b,
case_t const &  cf,
int8_t const  ci,
bMoveList ml 
) const
protected

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 894 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 ( bBoard const &  b,
case_t const &  cf,
int8_t const  ci,
bMoveList ml 
) const
protected

Definition at line 795 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 ( bBoard const &  b,
case_t const &  cf,
bMoveList ml 
) const
protected

Definition at line 824 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 ( bBoard const &  b,
case_t const &  cf,
int8_t const  ci,
bMoveList ml 
) const
protected

Definition at line 856 of file piece.cpp.

Referenced by GenerateMoves().

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