osl::rating::PatternLong Class Reference

`#include <pattern.h>`

Inheritance diagram for osl::rating::PatternLong:

## Public Member Functions

| PatternLong (Direction d, Ptype s, LongTarget t)
bool | match (const NumEffectState &state, Move move, const RatingEnv &env) const
Public Member Functions inherited from osl::rating::Feature
| Feature (const std::string &name)
virtual | ~Feature ()
virtual bool | effectiveInCheck () const
const std::string & | name () const

## Static Public Member Functions

static const PieceSquare | nextPieceOrEnd (const SimpleState &state, Square start, Player player, Direction direction)
| direction方向に空白を進み、駒を探す
static const PieceSquare | nextPieceOrEnd (const SimpleState &state, Square start, Offset)
static const PieceSquare | find (const NumEffectState &state, Move move, Direction direction)

## Static Private Member Functions

static const std::string | name (Direction d, Ptype self)

## Private Attributes

Direction | direction
Ptype | self
LongTarget | target

## Detailed Description

Definition at line 122 of file pattern.h.

## Constructor & Destructor Documentation

## PatternLong()

osl::rating::PatternLong::PatternLong | ( | Direction | d,
|  | Ptype | s,
|  | LongTarget | t )

Definition at line 32 of file pattern.cc.

References osl::BISHOP, direction, osl::rating::Feature::Feature(), osl::LANCE, name(), osl::ROOK, self, target, and osl::unpromote().

## Member Function Documentation

## find()

const osl::rating::PieceSquare osl::rating::PatternLong::find | ( | const NumEffectState & | state,
|  | Move | move,
|  | Direction | direction )

static

Definition at line 65 of file pattern.cc.

References direction, osl::Move::from(), nextPieceOrEnd(), osl::Move::player(), and osl::Move::to().

Referenced by osl::rating::PatternLongGroup::findMatch(), and match().

## match()

bool osl::rating::PatternLong::match | ( | const NumEffectState & | state,
|  | Move | move,
|  | const RatingEnv & | env ) const

inline virtual

Implements osl::rating::Feature.

Definition at line 140 of file pattern.h.

References direction, find(), osl::Move::ptype(), self, and target.

## name()

const std::string osl::rating::PatternLong::name | ( | Direction | d,
|  | Ptype | self )

static private

Definition at line 74 of file pattern.cc.

References osl::Ptype_Table, and self.

Referenced by PatternLong().

## nextPieceOrEnd() [1/2]

const osl::rating::PieceSquare osl::rating::PatternLong::nextPieceOrEnd | ( | const SimpleState & | state,
|  | Square | start,
|  | Offset | diff )

static

Definition at line 39 of file pattern.cc.

References osl::Piece::EMPTY(), osl::Piece::isEdge(), osl::Square::isOnBoard(), osl::SimpleState::pieceAt(), osl::SimpleState::pieceOnBoard(), and osl::Offset::zero().

## nextPieceOrEnd() [2/2]

const osl::rating::PieceSquare osl::rating::PatternLong::nextPieceOrEnd | ( | const SimpleState & | state,
|  | Square | start,
|  | Player | player,
|  | Direction | direction )

static

direction方向に空白を進み、駒を探す

- 駒を発見 -> その駒
- 盤の外 – その手前が空白 -> その空白 – その手前がスタート地点 -> PTYPE_EDGE

Definition at line 58 of file pattern.cc.

References osl::Board_Table, direction, and nextPieceOrEnd().

Referenced by osl::rating::PatternBlock::find(), find(), and nextPieceOrEnd().

## Member Data Documentation

## direction

Direction osl::rating::PatternLong::direction

private

Definition at line 124 of file pattern.h.

Referenced by find(), match(), nextPieceOrEnd(), and PatternLong().

## self

Ptype osl::rating::PatternLong::self

private

Definition at line 125 of file pattern.h.

Referenced by match(), name(), and PatternLong().

## target

LongTarget osl::rating::PatternLong::target

private

Definition at line 126 of file pattern.h.

Referenced by match(), and PatternLong().

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

- pattern.h
- pattern.cc