Identifier for board state including history. More...
#include <GoBoardHistory.h>
Public Member Functions | |
GoBoardHistory () | |
Constructor. | |
void | SetFromBoard (const GoBoard &bd) |
Initialize from a current board position. | |
bool | IsAlternatePlayFollowUpOf (const GoBoardHistory &other, std::vector< SgPoint > &sequence) |
Check if this position is a alternate-play follow-up to another one. | |
Private Attributes | |
int | m_boardSize |
GoRules | m_rules |
GoSetup | m_setup |
SgArrayList< GoPlayerMove, GO_MAX_NUM_MOVES > | m_moves |
SgBlackWhite | m_toPlay |
Identifier for board state including history.
This class can be used, for instance, to uniquely remember a board position for reusing parts of previous computations. The state includes:
Definition at line 21 of file GoBoardHistory.h.
GoBoardHistory::GoBoardHistory | ( | ) |
Constructor.
The initial state is that the history does not correspond to any valid position.
Definition at line 52 of file GoBoardHistory.h.
bool GoBoardHistory::IsAlternatePlayFollowUpOf | ( | const GoBoardHistory & | other, | |
std::vector< SgPoint > & | sequence | |||
) |
Check if this position is a alternate-play follow-up to another one.
other | The other position | |
[out] | sequence | The sequence leading from the other position to this one |
true
If the position is a follow-up Definition at line 24 of file GoBoardHistory.cpp.
References GoPlayerMove::Color(), SgArrayList< T, SIZE >::Length(), m_boardSize, m_moves, m_rules, m_setup, m_toPlay, GoPlayerMove::Point(), and SgOppBW().
void GoBoardHistory::SetFromBoard | ( | const GoBoard & | bd | ) |
Initialize from a current board position.
Definition at line 13 of file GoBoardHistory.cpp.
References SgArrayList< T, SIZE >::Clear(), m_boardSize, m_moves, m_rules, m_setup, m_toPlay, GoBoard::Move(), GoBoard::MoveNumber(), SgArrayList< T, SIZE >::PushBack(), GoBoard::Rules(), GoBoard::Setup(), GoBoard::Size(), and GoBoard::ToPlay().
int GoBoardHistory::m_boardSize [private] |
Definition at line 41 of file GoBoardHistory.h.
Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().
Definition at line 47 of file GoBoardHistory.h.
Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().
GoRules GoBoardHistory::m_rules [private] |
Definition at line 43 of file GoBoardHistory.h.
Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().
GoSetup GoBoardHistory::m_setup [private] |
Definition at line 45 of file GoBoardHistory.h.
Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().
SgBlackWhite GoBoardHistory::m_toPlay [private] |
Definition at line 49 of file GoBoardHistory.h.
Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().