Data used for pattern matching. More...
#include <PatternState.hpp>
Public Member Functions | |
HexPoint | GetRotatedMove (HexPoint cell, int slice, int bit, int angle) const |
Returns the HexPoint of the position (slice, bit) centered on cell and rotated by angle. | |
Static Public Member Functions | |
static const PatternMatcherData * | Get (const ConstBoard *brd) |
Returns instance for given board. | |
Public Attributes | |
const ConstBoard * | brd |
Board data is defined on. | |
int | played_in_slice [BITSETSIZE][BITSETSIZE] |
For x: slice in which y resides. | |
int | played_in_godel [BITSETSIZE][BITSETSIZE] |
For x: godel in the slice in which y resides. | |
int | played_in_edge [BITSETSIZE][4][Pattern::NUM_SLICES] |
For x, edge y, slice s: set of godels edge hits. | |
HexPoint | inverse_slice_godel [BITSETSIZE][Pattern::NUM_SLICES][32] |
Maps a cell's (slice,godel) to a point. | |
Private Member Functions | |
PatternMatcherData (const ConstBoard *brd) | |
Constructor. | |
void | Initialize () |
For each cell, store the slice and godel for every other cell. |
Data used for pattern matching.
Definition at line 97 of file PatternState.hpp.
PatternMatcherData::PatternMatcherData | ( | const ConstBoard * | brd | ) | [private] |
Constructor.
Definition at line 28 of file PatternState.cpp.
References Initialize().
Referenced by Get().
const PatternMatcherData * PatternMatcherData::Get | ( | const ConstBoard * | brd | ) | [static] |
Returns instance for given board.
Definition at line 13 of file PatternState.cpp.
References LogFine(), and PatternMatcherData().
Returns the HexPoint of the position (slice, bit) centered on cell and rotated by angle.
Definition at line 116 of file PatternState.cpp.
References inverse_slice_godel, and Pattern::NUM_SLICES.
Referenced by PatternState::CheckRotatedPattern().
void PatternMatcherData::Initialize | ( | ) | [private] |
For each cell, store the slice and godel for every other cell.
Definition at line 35 of file PatternState.cpp.
References brd, BoardUtils::CoordsToPoint(), HexPointUtil::DeltaX(), HexPointUtil::DeltaY(), EAST, FIRST_EDGE, ConstBoard::Height(), ConstBoard::Interior(), INVALID_POINT, inverse_slice_godel, HexPointUtil::isEdge(), LogFine(), Pattern::MAX_EXTENSION, NORTH, NUM_DIRECTIONS, Pattern::NUM_SLICES, played_in_edge, played_in_godel, played_in_slice, HexPointUtil::pointToCoords(), SOUTH, WEST, and ConstBoard::Width().
Referenced by PatternMatcherData().
Board data is defined on.
Definition at line 105 of file PatternState.hpp.
Referenced by Initialize().
Maps a cell's (slice,godel) to a point.
Definition at line 117 of file PatternState.hpp.
Referenced by GetRotatedMove(), Initialize(), and PatternState::UpdateRingGodel().
For x, edge y, slice s: set of godels edge hits.
Definition at line 114 of file PatternState.hpp.
Referenced by Initialize(), and PatternState::Update().
For x: godel in the slice in which y resides.
Definition at line 111 of file PatternState.hpp.
Referenced by Initialize(), and PatternState::Update().
For x: slice in which y resides.
Definition at line 108 of file PatternState.hpp.
Referenced by Initialize(), and PatternState::Update().