Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgMiaiMap Class Reference

#include <SgMiaiMap.h>

List of all members.


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 26 of file SgMiaiMap.h.

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.


Constructor & Destructor Documentation

SgMiaiMap::SgMiaiMap (  ) 

Initialize to empty map.

Definition at line 14 of file SgMiaiMap.cpp.


Member Function Documentation

void SgMiaiMap::ConvertFromSgMiaiStrategy ( const SgMiaiStrategy s  ) 

Convert SgMiaiStrategy into SgMiaiMap.

The SgMiaiStrategy must not have overlapping threats.

Definition at line 54 of file SgMiaiMap.cpp.

References SgMiaiStrategy::HasOverlappingMiaiPairs(), m_forcedMove, m_map, SgMiaiStrategy::MiaiStrategies(), SgMiaiStrategy::OpenThreatMove(), SgStrategy::Player(), SG_ASSERT, and SG_NULLPOINT.

void SgMiaiMap::ConvertToSgMiaiStrategy ( SgMiaiStrategy s  )  const

Convert SgMiaiMap into SgMiaiStrategy.

Definition at line 73 of file SgMiaiMap.cpp.

References SG_ASSERT, and SG_UNUSED().

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

See SgStrategy::ExecuteMove.

Definition at line 22 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 36 of file SgMiaiMap.h.

References m_forcedMove.

SgStrategyStatus SgMiaiMap::Status (  )  const

See SgStrategyStatus.

Definition at line 47 of file SgMiaiMap.cpp.

References m_failed, m_forcedMove, SG_NULLPOINT, SGSTRATEGY_ACHIEVED, 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 56 of file SgMiaiMap.h.

Referenced by Status().

SgPoint SgMiaiMap::m_forcedMove [private]

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

Returns SG_NULLPOINT if no such move.

Definition at line 53 of file SgMiaiMap.h.

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

SgBWArray<SgArray<int,SG_MAXPOINT> > SgMiaiMap::m_map [private]

The maps, one for each color.

Definition at line 59 of file SgMiaiMap.h.

Referenced by ConvertFromSgMiaiStrategy(), and ExecuteMove().


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


17 Jun 2010 Doxygen 1.4.7