osl::Offset Class Reference

座標の差分 More...

`#include <basic_type.h>`

## Public Types

enum | { OFFSET_MIN =-0x100 , ONBOARD_OFFSET_MIN =-0x88 , OFFSET_ZERO =0 , ONBOARD_OFFSET_MAX =0x88 , OFFSET_MAX =0x100 , ONBOARD_OFFSET_SIZE =0x88*2+1 }

## Public Member Functions

int | intValue () const
| Offset (int dx, int dy)
| Offset (Player, Direction)
| Offset ()
int | dx () const
| Offsetから一般に dxは求まらないので, ここでの入力は12近傍のみとする
int | dy () const
| Offsetから一般に dyは求まらないので, ここでの入力は12近傍のみとする
unsigned int | index () const
Offset & | operator+= (Offset other)
Offset & | operator-= (Offset other)
const Offset | operator+ (Offset other) const
const Offset | operator- (const Offset other) const
const Offset | operator* (const int mult) const
const Offset | operator- () const
template<Player P>
const Offset | blackOffset () const
| Player P からみた offset を黒番のものに変更する
bool | zero () const

## Static Public Member Functions

static const Offset | makeDirect (int value)
static int | makeOffset (int dx, int dy)
template<Player, Direction>
static Offset | make ()
static const Offset | ZERO ()

## Static Public Attributes

static const int | BOARD_HEIGHT =16

## Private Member Functions

| Offset (int o)

## Private Attributes

int | offset

## Detailed Description

座標の差分

Definition at line 429 of file basic_type.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
OFFSET_MIN |
ONBOARD_OFFSET_MIN |
OFFSET_ZERO |
ONBOARD_OFFSET_MAX |
OFFSET_MAX |
ONBOARD_OFFSET_SIZE |

Definition at line 432 of file basic_type.h.

## Constructor & Destructor Documentation

## Offset() [1/4]

osl::Offset::Offset | ( | int | o | ) |

inline explicit private

Definition at line 443 of file basic_type.h.

References offset.

Referenced by blackOffset(), make(), makeDirect(), operator*(), operator+(), operator+=(), operator-(), operator-(), operator-=(), and ZERO().

## Offset() [2/4]

osl::Offset::Offset | ( | int | dx,
|  | int | dy )

inline

Definition at line 451 of file basic_type.h.

References dx(), dy(), makeOffset(), and offset.

## Offset() [3/4]

osl::Offset::Offset | ( | Player | player,
|  | Direction | direction )

Definition at line 110 of file basic_type.cc.

References osl::Board_Table.

## Offset() [4/4]

osl::Offset::Offset | ( |  | ) |

inline

Definition at line 455 of file basic_type.h.

References offset, and OFFSET_ZERO.

Referenced by makeDirect(), operator-(), and ZERO().

## Member Function Documentation

## blackOffset()

template<Player P>

const Offset osl::Offset::blackOffset | ( |  | ) | const

inline

Player P からみた offset を黒番のものに変更する

Definition at line 500 of file basic_type.h.

References osl::BLACK, and Offset().

## dx()

int osl::Offset::dx | ( |  | ) | const

Offsetから一般に dxは求まらないので, ここでの入力は12近傍のみとする

Definition at line 119 of file basic_type.cc.

References index(), OFFSET_INDEX, and ZERO().

Referenced by osl::effect_util::Neighboring8Direct::Table::init(), osl::effect_util::SendOffSquare::Table::init(), makeOffset(), and Offset().

## dy()

int osl::Offset::dy | ( |  | ) | const

Offsetから一般に dyは求まらないので, ここでの入力は12近傍のみとする

Definition at line 146 of file basic_type.cc.

References index(), and OFFSET_INDEX.

Referenced by osl::effect_util::Neighboring8Direct::Table::init(), osl::effect_util::SendOffSquare::Table::init(), makeOffset(), and Offset().

## index()

unsigned int osl::Offset::index | ( |  | ) | const

inline

Definition at line 471 of file basic_type.h.

References offset, and OFFSET_MIN.

Referenced by dx(), dy(), osl::eval::ml::PiecePair::evalWithUpdate(), and osl::eval::ml::PiecePair::evalWithUpdateCompiled().

## intValue()

int osl::Offset::intValue | ( |  | ) | const

inline

Definition at line 448 of file basic_type.h.

References offset.

Referenced by osl::NumEffectState::forEachEffectOfPieceLongDir(), osl::Move::newAddTo(), osl::Piece::operator+=(), osl::Square::operator+=(), osl::Square::operator-=(), osl::operator<(), osl::operator<<(), osl::operator==(), and osl::BoardTable::setDirections().

## make()

template<Player P, Direction D>

Offset osl::Offset::make | ( |  | ) |

static

Definition at line 265 of file directionTraits.h.

References Offset().

Referenced by osl::eval::ml::AttackMajorsInBase::addOne().

## makeDirect()

const Offset osl::Offset::makeDirect | ( | int | value | ) |

inline static

Definition at line 447 of file basic_type.h.

References Offset(), and Offset().

Referenced by osl::BoardTable::getShort8(), osl::BoardTable::getShort8OffsetUnsafe(), osl::EffectContent::offset(), and osl::Square::operator-().

## makeOffset()

int osl::Offset::makeOffset | ( | int | dx,
|  | int | dy )

inline static

Definition at line 450 of file basic_type.h.

References BOARD_HEIGHT, dx(), and dy().

Referenced by Offset().

## operator*()

const Offset osl::Offset::operator* | ( | const int | mult | ) | const

inline

Definition at line 492 of file basic_type.h.

References Offset(), and offset.

## operator+()

const Offset osl::Offset::operator+ | ( | Offset | other | ) | const

inline

Definition at line 482 of file basic_type.h.

References Offset().

## operator+=()

Offset & osl::Offset::operator+= | ( | Offset | other | ) |

inline

Definition at line 473 of file basic_type.h.

References Offset(), and offset.

## operator-() [1/2]

const Offset osl::Offset::operator- | ( |  | ) | const

inline

Definition at line 495 of file basic_type.h.

References Offset(), Offset(), and offset.

## operator-() [2/2]

const Offset osl::Offset::operator- | ( | const Offset | other | ) | const

inline

Definition at line 487 of file basic_type.h.

References Offset().

## operator-=()

Offset & osl::Offset::operator-= | ( | Offset | other | ) |

inline

Definition at line 478 of file basic_type.h.

References Offset(), and offset.

## ZERO()

const Offset osl::Offset::ZERO | ( |  | ) |

inline static

Definition at line 460 of file basic_type.h.

References Offset(), Offset(), and OFFSET_ZERO.

Referenced by dx().

## zero()

bool osl::Offset::zero | ( |  | ) | const

inline

Definition at line 502 of file basic_type.h.

References offset, and OFFSET_ZERO.

Referenced by osl::move_classifier::PawnDropCheckmate< P >::canEscape(), osl::checkmate::ProofNumberTable::countLibertyLong(), osl::mobility::countMobilityBoth(), osl::move_probability::CoverFork::defending(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::effect_util::AdditionalEffect::find(), osl::eval::See::findAdditionalPieces(), osl::effect_util::Neighboring8Direct::Table::findNearest(), osl::effect_util::Neighboring8Direct::Table::hasEffect(), osl::effect_util::Neighboring8Direct::Table::hasEffectOrAdditional(), osl::effect_util::Neighboring8Direct::Table::init(), osl::SimpleState::isAlmostValidMove(), osl::SimpleState::isEmptyBetween(), osl::SimpleState::isEmptyBetween(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::SimpleState::isValidMoveByRule(), osl::move_probability::PromotionBySacrifice::match(), osl::SimpleState::nextPiece(), and osl::rating::PatternLong::nextPieceOrEnd().

## Member Data Documentation

## BOARD_HEIGHT

const int osl::Offset::BOARD_HEIGHT =16

static

Definition at line 440 of file basic_type.h.

Referenced by osl::Square::makeNoCheck(), and makeOffset().

## offset

int osl::Offset::offset

private

Definition at line 442 of file basic_type.h.

Referenced by index(), intValue(), Offset(), Offset(), Offset(), operator*(), operator+=(), operator-(), operator-=(), and zero().

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

- basic_type.h
- basic_type.cc
- directionTraits.h