My Project
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
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

Definition at line 443 of file basic_type.h.

◆ Offset() [2/4]

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

Definition at line 451 of file basic_type.h.

◆ Offset() [3/4]

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

Definition at line 110 of file basic_type.cc.

References osl::Board_Table, and osl::BoardTable::getOffset().

◆ Offset() [4/4]

osl::Offset::Offset ( )
inline

Definition at line 455 of file basic_type.h.

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.

◆ dx()

int osl::Offset::dx ( ) const

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

Definition at line 119 of file basic_type.cc.

References OFFSET_INDEX.

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

◆ dy()

int osl::Offset::dy ( ) const

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

Definition at line 146 of file basic_type.cc.

References OFFSET_INDEX.

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

◆ index()

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

◆ intValue()

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

◆ make()

template<Player P, Direction D>
Offset osl::Offset::make ( )
static

Definition at line 265 of file directionTraits.h.

◆ makeDirect()

static const Offset osl::Offset::makeDirect ( int  value)
inlinestatic

◆ makeOffset()

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

Definition at line 450 of file basic_type.h.

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

◆ operator*()

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

Definition at line 492 of file basic_type.h.

References offset.

◆ operator+()

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

Definition at line 482 of file basic_type.h.

◆ operator+=()

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

Definition at line 473 of file basic_type.h.

References offset.

◆ operator-() [1/2]

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

Definition at line 495 of file basic_type.h.

References 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.

◆ operator-=()

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

Definition at line 478 of file basic_type.h.

References offset.

◆ ZERO()

static const Offset osl::Offset::ZERO ( )
inlinestatic

Definition at line 460 of file basic_type.h.

References Offset(), and OFFSET_ZERO.

◆ zero()

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

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(), operator*(), operator+=(), operator-(), operator-=(), and zero().


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