Used to execute and undo one move without having to worry about undoing the move. More...
#include <GoMoveExecutor.h>
Public Member Functions | |
GoMoveExecutor (GoBoard &board, SgPoint move) | |
GoMoveExecutor (GoBoard &board, SgPoint move, SgBlackWhite player) | |
~GoMoveExecutor () | |
bool | IsLegal () const |
void | UndoMove () |
Can be used to undo the move before the MoveExecutor is destructed, to force the situation back the previous state. | |
Private Member Functions | |
GoMoveExecutor (const GoMoveExecutor &) | |
Not implemented. | |
GoMoveExecutor & | operator= (const GoMoveExecutor &) |
Not implemented. | |
Private Attributes | |
GoBoard & | m_board |
bool | m_isLegal |
Used to execute and undo one move without having to worry about undoing the move.
Definition at line 15 of file GoMoveExecutor.h.
Definition at line 18 of file GoMoveExecutor.h.
References m_board, m_isLegal, and GoBoardUtil::PlayIfLegal().
GoMoveExecutor::GoMoveExecutor | ( | GoBoard & | board, | |
SgPoint | move, | |||
SgBlackWhite | player | |||
) |
Definition at line 24 of file GoMoveExecutor.h.
References m_board, m_isLegal, and GoBoardUtil::PlayIfLegal().
GoMoveExecutor::~GoMoveExecutor | ( | ) |
Definition at line 30 of file GoMoveExecutor.h.
References m_board, m_isLegal, and GoBoard::Undo().
GoMoveExecutor::GoMoveExecutor | ( | const GoMoveExecutor & | ) | [private] |
Not implemented.
bool GoMoveExecutor::IsLegal | ( | ) | const |
Definition at line 36 of file GoMoveExecutor.h.
References m_isLegal.
GoMoveExecutor& GoMoveExecutor::operator= | ( | const GoMoveExecutor & | ) | [private] |
Not implemented.
void GoMoveExecutor::UndoMove | ( | ) |
Can be used to undo the move before the MoveExecutor is destructed, to force the situation back the previous state.
Note that this can only be called for legal moves, and IsLegal returns false afterwards.
Definition at line 45 of file GoMoveExecutor.h.
References m_board, m_isLegal, SG_ASSERT, and GoBoard::Undo().
GoBoard& GoMoveExecutor::m_board [private] |
Definition at line 53 of file GoMoveExecutor.h.
Referenced by GoMoveExecutor(), UndoMove(), and ~GoMoveExecutor().
bool GoMoveExecutor::m_isLegal [private] |
Definition at line 55 of file GoMoveExecutor.h.
Referenced by GoMoveExecutor(), IsLegal(), UndoMove(), and ~GoMoveExecutor().