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

SgMiaiMap Class Reference

Efficient implementation of a SgMiaiStrategy. More...

#include <SgMiaiMap.h>

List of all members.

Public Member Functions

 SgMiaiMap ()
 Initialize to empty map.
void ExecuteMove (SgPoint p, SgBlackWhite player)
 See SgStrategy::ExecuteMove.
SgPoint ForcedMove () const
 See m_forcedMove.
SgStrategyStatus Status () const
 See SgStrategyStatus.
void ConvertFromSgMiaiStrategy (const SgMiaiStrategy &s)
 Convert SgMiaiStrategy into SgMiaiMap.
void ConvertToSgMiaiStrategy (SgMiaiStrategy *s) const
 Convert SgMiaiMap into SgMiaiStrategy.

Private Attributes

SgPoint m_forcedMove
 Move that must be played to stop or convert an open threat.
bool m_failed
 Strategy has failed if opponent has occupied both points in a pair.
SgBWArray< SgArray< int,
SG_MAXPOINT > > 
m_map
 The maps, one for each color.

Detailed Description

Efficient implementation of a SgMiaiStrategy.

The miai strategy must be achievable (not broken). Uses two boards, one for each color. Board entries either point to the miai point, or are set to SG_NULLPOINT if the point is not part of a miai. Can only be used going forward through a game - does not support undo.

Definition at line 24 of file SgMiaiMap.h.


Constructor & Destructor Documentation

SgMiaiMap::SgMiaiMap (  ) 

Initialize to empty map.

Definition at line 13 of file SgMiaiMap.cpp.


Member Function Documentation

void SgMiaiMap::ConvertFromSgMiaiStrategy ( const SgMiaiStrategy s  ) 
void SgMiaiMap::ConvertToSgMiaiStrategy ( SgMiaiStrategy s  )  const

Convert SgMiaiMap into SgMiaiStrategy.

Definition at line 72 of file SgMiaiMap.cpp.

References SG_ASSERT, and SG_UNUSED().

void SgMiaiMap::ExecuteMove ( SgPoint  p,
SgBlackWhite  player 
)

See SgStrategy::ExecuteMove.

Definition at line 21 of file SgMiaiMap.cpp.

References m_forcedMove, m_map, SG_ASSERT, SG_NULLPOINT, and SgOppBW().

SgPoint SgMiaiMap::ForcedMove (  )  const

See m_forcedMove.

Definition at line 34 of file SgMiaiMap.h.

References m_forcedMove.

SgStrategyStatus SgMiaiMap::Status (  )  const

See SgStrategyStatus.

Definition at line 46 of file SgMiaiMap.cpp.

References m_failed, m_forcedMove, SG_NULLPOINT, SGSTRATEGY_FAILED, and SGSTRATEGY_THREATENED.


Member Data Documentation

bool SgMiaiMap::m_failed [private]

Strategy has failed if opponent has occupied both points in a pair.

Definition at line 51 of file SgMiaiMap.h.

Referenced by Status().

Move that must be played to stop or convert an open threat.

Returns SG_NULLPOINT if no such move.

Definition at line 48 of file SgMiaiMap.h.

Referenced by ConvertFromSgMiaiStrategy(), ExecuteMove(), ForcedMove(), and Status().

The maps, one for each color.

Definition at line 54 of file SgMiaiMap.h.

Referenced by ConvertFromSgMiaiStrategy(), and ExecuteMove().


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


Sun Mar 13 2011 Doxygen 1.7.1