Used to alter state of repetition and self-removal for certain periods of play. More...
#include <GoBoardUtil.h>
Public Member Functions | |
GoRestoreRepetitionAndSuicide (GoBoard &board, bool allowAnyRepetition, bool allowKoRepetition, bool allowSuicide) | |
~GoRestoreRepetitionAndSuicide () | |
Private Member Functions | |
GoRestoreRepetitionAndSuicide (const GoRestoreRepetitionAndSuicide &) | |
Not implemented. | |
GoRestoreRepetitionAndSuicide & | operator= (const GoRestoreRepetitionAndSuicide &) |
Not implemented. | |
Private Attributes | |
GoBoard & | m_board |
bool | m_oldAnyRepetition |
arbitrary repetition for both players | |
bool | m_oldKoRepetition |
bool | m_oldSuicide |
whether self-removal is allowed |
Used to alter state of repetition and self-removal for certain periods of play.
Restores the settings to the previous values in an exception-safe way. To use it, just declare a RestoreRepetitionAndRemoval variable on the stack for the desired scope.
Definition at line 1025 of file GoBoardUtil.h.
GoRestoreRepetitionAndSuicide::GoRestoreRepetitionAndSuicide | ( | GoBoard & | board, | |
bool | allowAnyRepetition, | |||
bool | allowKoRepetition, | |||
bool | allowSuicide | |||
) |
Definition at line 1028 of file GoBoardUtil.h.
References GoBoard::AllowAnyRepetition(), GoBoard::AllowKoRepetition(), m_board, GoBoard::Rules(), and GoRules::SetAllowSuicide().
GoRestoreRepetitionAndSuicide::~GoRestoreRepetitionAndSuicide | ( | ) |
Definition at line 1040 of file GoBoardUtil.h.
References GoBoard::AllowAnyRepetition(), GoBoard::AllowKoRepetition(), m_board, m_oldAnyRepetition, m_oldKoRepetition, m_oldSuicide, GoBoard::Rules(), and GoRules::SetAllowSuicide().
GoRestoreRepetitionAndSuicide::GoRestoreRepetitionAndSuicide | ( | const GoRestoreRepetitionAndSuicide & | ) | [private] |
Not implemented.
GoRestoreRepetitionAndSuicide& GoRestoreRepetitionAndSuicide::operator= | ( | const GoRestoreRepetitionAndSuicide & | ) | [private] |
Not implemented.
GoBoard& GoRestoreRepetitionAndSuicide::m_board [private] |
Definition at line 1048 of file GoBoardUtil.h.
Referenced by GoRestoreRepetitionAndSuicide(), and ~GoRestoreRepetitionAndSuicide().
bool GoRestoreRepetitionAndSuicide::m_oldAnyRepetition [private] |
arbitrary repetition for both players
Definition at line 1051 of file GoBoardUtil.h.
Referenced by ~GoRestoreRepetitionAndSuicide().
bool GoRestoreRepetitionAndSuicide::m_oldKoRepetition [private] |
Definition at line 1053 of file GoBoardUtil.h.
Referenced by ~GoRestoreRepetitionAndSuicide().
bool GoRestoreRepetitionAndSuicide::m_oldSuicide [private] |
whether self-removal is allowed
Definition at line 1056 of file GoBoardUtil.h.
Referenced by ~GoRestoreRepetitionAndSuicide().