Belofte version 2.1.8
A promising chess program using the UCI or Winboard interface
bMove Class Reference

#include <move.h>

+ Inheritance diagram for bMove:
+ Collaboration diagram for bMove:

Public Member Functions

 bMove (bMove const &m)
 
 bMove (bMove &&m)
 
 bMove (case_t cf, case_t ct)
 
 ~bMove () override
 
bMoveoperator= (bMove &&m)
 
bool operator> (bMove const &r) const
 
bMoveoperator= (bMove const &)=delete
 
piece_t getWhitePromotionPiece () const
 
piece_t getBlackPromotionPiece () const
 
bool isPromotion () const
 
bool isMajorPromotion () const
 test if major promotion or mating promotion (queen, knight) if minor promotion, move is considered as silent
 
void setPromotion (const ppiece_t p)
 
bool isCapture () const
 
void setCapture ()
 
bool isPawnMove () const
 
void setPawnMove ()
 
bool isCastleMove () const
 
void setShortCastleMove ()
 
void setLongCastleMove ()
 
bool isLongCastleMove () const
 
bool isCheck () const
 
void setCheck ()
 
void setGameEnd ()
 
bool getGameEnd () const
 
bool isEndOfGame () const
 Flag if mated.
 
bool isEPPossible () const
 
void setEPPossible ()
 
bool isEPMove () const
 
void setEPMove ()
 
bool isNonSilent () const
 
void setScore (bScore const s)
 
bScore getScore () const
 
std::string getMoveEvalStr () const
 
- Public Member Functions inherited from bBasicMove
 bBasicMove (bBasicMove const &bm)
 
 bBasicMove (bBasicMove &&bm)
 
 bBasicMove (basicmove_t const bmt)
 
 bBasicMove (case_t cf, case_t ct)
 
virtual ~bBasicMove ()
 
bBasicMoveoperator= (bBasicMove &&bm)
 
bBasicMoveoperator= (bBasicMove const &bm)
 
 operator std::string () const
 
MEMBER_CONSTEXPR case_t from () const
 
MEMBER_CONSTEXPR case_t to () const
 
rank_t fromrank () const
 
column_t fromcolumn () const
 
rank_t torank () const
 
column_t tocolumn () const
 
basicmove_t getBasicMoveT () const
 
ppiece_t getPromotion () const
 

Additional Inherited Members

- Protected Attributes inherited from bBasicMove
union { 
 
   uint32_t   u_bmove = 0UL 
 
   struct { 
 
      basicmove_t   m_bmove 
 
      uint8_t   m_flag 
 
      ppiece_t   m_promotion 
 
   }  
 
};  
 

Detailed Description

Definition at line 69 of file move.h.

Constructor & Destructor Documentation

◆ bMove() [1/3]

bMove::bMove ( bMove const &  m)

Definition at line 82 of file move.cpp.

◆ bMove() [2/3]

bMove::bMove ( bMove &&  m)
explicit

Definition at line 88 of file move.cpp.

◆ bMove() [3/3]

bMove::bMove ( case_t  cf,
case_t  ct 
)
explicit

Definition at line 94 of file move.cpp.

◆ ~bMove()

bMove::~bMove ( )
override

Definition at line 99 of file move.cpp.

Member Function Documentation

◆ operator=() [1/2]

bMove & bMove::operator= ( bMove &&  m)

Definition at line 103 of file move.cpp.

+ Here is the call graph for this function:

◆ operator>()

bool bMove::operator> ( bMove const &  r) const

Definition at line 110 of file move.cpp.

+ Here is the call graph for this function:

◆ operator=() [2/2]

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

◆ getWhitePromotionPiece()

piece_t bMove::getWhitePromotionPiece ( ) const

Definition at line 159 of file move.cpp.

◆ getBlackPromotionPiece()

piece_t bMove::getBlackPromotionPiece ( ) const

Definition at line 173 of file move.cpp.

◆ isPromotion()

bool bMove::isPromotion ( ) const
inline

Definition at line 83 of file move.h.

◆ isMajorPromotion()

bool bMove::isMajorPromotion ( ) const

test if major promotion or mating promotion (queen, knight) if minor promotion, move is considered as silent

Definition at line 152 of file move.cpp.

Referenced by isNonSilent().

+ Here is the caller graph for this function:

◆ setPromotion()

void bMove::setPromotion ( const ppiece_t  p)
inline

Definition at line 85 of file move.h.

Referenced by bMoveList::addBlackPromotionIfValid(), and bMoveList::addWhitePromotionIfValid().

+ Here is the caller graph for this function:

◆ isCapture()

bool bMove::isCapture ( ) const
inline

Definition at line 87 of file move.h.

Referenced by getMoveEvalStr(), and isNonSilent().

+ Here is the caller graph for this function:

◆ setCapture()

void bMove::setCapture ( )
inline

◆ isPawnMove()

bool bMove::isPawnMove ( ) const
inline

Definition at line 89 of file move.h.

◆ setPawnMove()

void bMove::setPawnMove ( )
inline

Definition at line 90 of file move.h.

◆ isCastleMove()

bool bMove::isCastleMove ( ) const
inline

Definition at line 91 of file move.h.

◆ setShortCastleMove()

void bMove::setShortCastleMove ( )
inline

Definition at line 92 of file move.h.

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

+ Here is the caller graph for this function:

◆ setLongCastleMove()

void bMove::setLongCastleMove ( )
inline

Definition at line 93 of file move.h.

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

+ Here is the caller graph for this function:

◆ isLongCastleMove()

bool bMove::isLongCastleMove ( ) const
inline

Definition at line 94 of file move.h.

◆ isCheck()

bool bMove::isCheck ( ) const
inline

Definition at line 95 of file move.h.

Referenced by getMoveEvalStr(), and isEndOfGame().

+ Here is the caller graph for this function:

◆ setCheck()

void bMove::setCheck ( )
inline

Definition at line 96 of file move.h.

◆ setGameEnd()

void bMove::setGameEnd ( )
inline

Definition at line 97 of file move.h.

◆ getGameEnd()

bool bMove::getGameEnd ( ) const
inline

Definition at line 98 of file move.h.

Referenced by isEndOfGame().

+ Here is the caller graph for this function:

◆ isEndOfGame()

bool bMove::isEndOfGame ( ) const

Flag if mated.

Returns
true if game ended

Definition at line 140 of file move.cpp.

Referenced by getMoveEvalStr().

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

◆ isEPPossible()

bool bMove::isEPPossible ( ) const
inline

Definition at line 100 of file move.h.

◆ setEPPossible()

void bMove::setEPPossible ( )
inline

Definition at line 101 of file move.h.

Referenced by bWhitePawn::addNonCaptureDoublePawnMove(), and bBlackPawn::addNonCaptureDoublePawnMove().

+ Here is the caller graph for this function:

◆ isEPMove()

bool bMove::isEPMove ( ) const
inline

Definition at line 102 of file move.h.

Referenced by getMoveEvalStr(), and isNonSilent().

+ Here is the caller graph for this function:

◆ setEPMove()

void bMove::setEPMove ( )
inline

Definition at line 103 of file move.h.

Referenced by bWhitePawn::addEPMove(), and bBlackPawn::addEPMove().

+ Here is the caller graph for this function:

◆ isNonSilent()

bool bMove::isNonSilent ( ) const
inline

Definition at line 104 of file move.h.

+ Here is the call graph for this function:

◆ setScore()

void bMove::setScore ( bScore const  s)
inline

Definition at line 106 of file move.h.

◆ getScore()

bScore bMove::getScore ( ) const
inline

Definition at line 107 of file move.h.

◆ getMoveEvalStr()

std::string bMove::getMoveEvalStr ( ) const
Todo:
convert to move annotation to be used in PgnMove as well

Definition at line 116 of file move.cpp.

+ Here is the call graph for this function: