Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Member Functions | Private Attributes

GoMoveExecutor Class Reference

Used to execute and undo one move without having to worry about undoing the move. More...

#include <GoMoveExecutor.h>

List of all members.

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.
GoMoveExecutoroperator= (const GoMoveExecutor &)
 Not implemented.

Private Attributes

GoBoardm_board
bool m_isLegal

Detailed Description

Used to execute and undo one move without having to worry about undoing the move.

Definition at line 15 of file GoMoveExecutor.h.


Constructor & Destructor Documentation

GoMoveExecutor::GoMoveExecutor ( GoBoard board,
SgPoint  move 
)

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.


Member Function Documentation

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().


Member Data Documentation

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().


The documentation for this class was generated from the following file:


Sun Mar 13 2011 Doxygen 1.7.1