GClasses
|
Iterates through all the possible moves for the specified color. It iterates through the pieces in a random order. It also iterates through the moves for each piece in a random order, but it will visit each move for the current piece before considering the next piece. More...
#include <GChess.h>
Public Member Functions | |
GChessMoveIterator () | |
Constructs a move iterator. (Doesn't call Reset, so you must still call Reset before you call GetNextMove). More... | |
~GChessMoveIterator () | |
bool | nextMove (int *xSrc, int *ySrc, int *xDest, int *yDest) |
Gets the next possible move for the specified color. Returns false if there are no more moves (so the values in xSrc, ySrc, xDest, and yDest are bogus) More... | |
void | reset (GChessBoard *pBoard, bool white, GRand *pRand) |
Resets the iterator and specifies the color whose moves you wish to iterate. More... | |
Protected Attributes | |
int | m_move |
int | m_moveCount |
int | m_moves [2 *MAX_PIECE_MOVES] |
int | m_n |
int | m_order [64] |
GChessBoard * | m_pBoard |
GRand * | m_pRand |
bool | m_white |
Iterates through all the possible moves for the specified color. It iterates through the pieces in a random order. It also iterates through the moves for each piece in a random order, but it will visit each move for the current piece before considering the next piece.
GClasses::GChessMoveIterator::GChessMoveIterator | ( | ) |
Constructs a move iterator. (Doesn't call Reset, so you must still call Reset before you call GetNextMove).
GClasses::GChessMoveIterator::~GChessMoveIterator | ( | ) |
bool GClasses::GChessMoveIterator::nextMove | ( | int * | xSrc, |
int * | ySrc, | ||
int * | xDest, | ||
int * | yDest | ||
) |
Gets the next possible move for the specified color. Returns false if there are no more moves (so the values in xSrc, ySrc, xDest, and yDest are bogus)
void GClasses::GChessMoveIterator::reset | ( | GChessBoard * | pBoard, |
bool | white, | ||
GRand * | pRand | ||
) |
Resets the iterator and specifies the color whose moves you wish to iterate.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |