Strategy for achieving a certain goal. More...
#include <SgStrategy.h>
Public Member Functions | |
SgStrategy (SgBlackWhite player) | |
virtual | ~SgStrategy () |
SgBlackWhite | Player () const |
See m_player. | |
virtual void | Clear () |
remove all data, reset to empty strategy. | |
virtual SgPointSet | Dependency () const =0 |
all points on board that can possibly affect strategy | |
virtual SgStrategyStatus | Status () const =0 |
check success of strategy on given board | |
virtual void | ExecuteMove (SgMove p, SgBlackWhite player)=0 |
update strategy with move | |
virtual void | UndoMove ()=0 |
go back to strategy state before move | |
virtual void | Write (std::ostream &stream) const |
Write object to stream. | |
Private Attributes | |
SgBlackWhite | m_player |
The player that this strategy is for. | |
SgHashCode | m_code |
Hash code of board region for which strategy is defined. |
Strategy for achieving a certain goal.
Pure virtual class, see e.g. SgMiaiStrategy for an implementation.
Definition at line 36 of file SgStrategy.h.
SgStrategy::SgStrategy | ( | SgBlackWhite | player | ) |
Definition at line 30 of file SgStrategy.cpp.
virtual SgStrategy::~SgStrategy | ( | ) | [virtual] |
Definition at line 41 of file SgStrategy.h.
void SgStrategy::Clear | ( | ) | [virtual] |
remove all data, reset to empty strategy.
Reimplemented in SgMiaiStrategy.
Definition at line 47 of file SgStrategy.cpp.
References SgHash< N >::Clear(), and m_code.
virtual SgPointSet SgStrategy::Dependency | ( | ) | const [pure virtual] |
all points on board that can possibly affect strategy
Implemented in SgMiaiStrategy.
virtual void SgStrategy::ExecuteMove | ( | SgMove | p, | |
SgBlackWhite | player | |||
) | [pure virtual] |
update strategy with move
SgBlackWhite SgStrategy::Player | ( | ) | const |
See m_player.
Definition at line 44 of file SgStrategy.h.
References m_player.
Referenced by SgMiaiMap::ConvertFromSgMiaiStrategy(), and SgMiaiStrategy::ExecuteMove().
virtual SgStrategyStatus SgStrategy::Status | ( | ) | const [pure virtual] |
virtual void SgStrategy::UndoMove | ( | ) | [pure virtual] |
go back to strategy state before move
Implemented in SgMiaiStrategy.
void SgStrategy::Write | ( | std::ostream & | stream | ) | const [virtual] |
Write object to stream.
Do not call directly, use operator<<
Reimplemented in SgMiaiStrategy.
Definition at line 40 of file SgStrategy.cpp.
References m_player, SgBW(), and Status().
Referenced by operator<<().
SgHashCode SgStrategy::m_code [private] |
Hash code of board region for which strategy is defined.
Definition at line 72 of file SgStrategy.h.
Referenced by Clear().
SgBlackWhite SgStrategy::m_player [private] |
The player that this strategy is for.
Definition at line 69 of file SgStrategy.h.