Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoBoardHistory Class Reference

#include <GoBoardHistory.h>

List of all members.


Detailed Description

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 22 of file 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
SgSList< GoPlayerMove, GO_MAX_NUM_MOVESm_moves
SgBlackWhite m_toPlay


Constructor & Destructor Documentation

GoBoardHistory::GoBoardHistory (  ) 

Constructor.

The initial state is that the history does not correspond to any valid position.

Definition at line 55 of file GoBoardHistory.h.


Member Function Documentation

bool GoBoardHistory::IsAlternatePlayFollowUpOf ( const GoBoardHistory other,
std::vector< SgPoint > &  sequence 
)

Check if this position is a alternate-play follow-up to another one.

Parameters:
other The other position
[out] sequence The sequence leading from the other position to this one
Returns:
true If the position is a follow-up

Definition at line 25 of file GoBoardHistory.cpp.

References SgSList< T, SIZE >::Length(), m_boardSize, m_moves, m_rules, m_setup, m_toPlay, and SgOppBW().

void GoBoardHistory::SetFromBoard ( const GoBoard bd  ) 

Initialize from a current board position.

Definition at line 14 of file GoBoardHistory.cpp.

References SgSList< T, SIZE >::Clear(), m_boardSize, m_moves, m_rules, m_setup, m_toPlay, GoBoard::Move(), GoBoard::MoveNumber(), SgSList< T, SIZE >::PushBack(), GoBoard::Rules(), GoBoard::Setup(), GoBoard::Size(), and GoBoard::ToPlay().


Member Data Documentation

int GoBoardHistory::m_boardSize [private]

Definition at line 44 of file GoBoardHistory.h.

Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().

SgSList<GoPlayerMove,GO_MAX_NUM_MOVES> GoBoardHistory::m_moves [private]

Definition at line 50 of file GoBoardHistory.h.

Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().

GoRules GoBoardHistory::m_rules [private]

Definition at line 46 of file GoBoardHistory.h.

Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().

GoSetup GoBoardHistory::m_setup [private]

Definition at line 48 of file GoBoardHistory.h.

Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().

SgBlackWhite GoBoardHistory::m_toPlay [private]

Definition at line 52 of file GoBoardHistory.h.

Referenced by IsAlternatePlayFollowUpOf(), and SetFromBoard().


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


17 Jun 2010 Doxygen 1.4.7