|
@@ -144,6 +144,7 @@ class chessy::PromotionGenerator
|
|
|
|
|
|
struct MoveIterator
|
|
struct MoveIterator
|
|
{
|
|
{
|
|
|
|
+ friend class chessy::PromotionGenerator;
|
|
const ChessGame& chessGame;
|
|
const ChessGame& chessGame;
|
|
PositionSet::PositionSetIterator pawns;
|
|
PositionSet::PositionSetIterator pawns;
|
|
PieceType promotionType;
|
|
PieceType promotionType;
|
|
@@ -152,6 +153,8 @@ class chessy::PromotionGenerator
|
|
inline Move operator *(void) const
|
|
inline Move operator *(void) const
|
|
{
|
|
{
|
|
Index pp = *pawns;
|
|
Index pp = *pawns;
|
|
|
|
+ if (!valid())
|
|
|
|
+ throw "";
|
|
return Move{ pp, int8_t(pp + (side == WHITE_SIDE ? 8 : -8) +
|
|
return Move{ pp, int8_t(pp + (side == WHITE_SIDE ? 8 : -8) +
|
|
direction), promotionType };
|
|
direction), promotionType };
|
|
}
|
|
}
|