My Project
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
Offsetoperator+= (Offset other)
Offsetoperator-= (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)
inlineexplicitprivate

◆ 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

◆ intValue()

◆ 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)
inlinestatic

◆ makeOffset()

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

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 ( )
inlinestatic

Definition at line 460 of file basic_type.h.

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

Referenced by dx().

◆ zero()

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

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