All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
osl::ntesuki::NtesukiMove Class Reference

Move に ntesuki 探索に関する情報を加えたもの More...

#include <ntesukiMove.h>

Collaboration diagram for osl::ntesuki::NtesukiMove:
Collaboration graph
[legend]

Public Member Functions

 NtesukiMove ()
 
 NtesukiMove (osl::Move m)
 
 NtesukiMove (osl::Move m, Flags f)
 
 NtesukiMove (const NtesukiMove &)
 
 ~NtesukiMove ()
 
NtesukiMove operator= (const NtesukiMove &)
 
void setCheck ()
 
bool isCheck () const
 
void setOrder (int o)
 
int getOrder () const
 
void setInterpose ()
 
bool isInterpose () const
 
void setLameLong ()
 
bool isLameLong () const
 
void setBySimulation ()
 
bool isBySimulation () const
 
void setNoPromote ()
 
bool isNoPromote () const
 
void setToOld ()
 
bool isToOld () const
 
template<Player P>
void setImmediateCheckmate ()
 
bool isImmediateCheckmate () const
 
template<Player P>
void setCheckmateSuccess (int pass_left)
 
template<Player P>
bool isCheckmateSuccess (int pass_left) const
 
bool isCheckmateSuccessSlow (Player P, int pass_left) const
 
template<Player P>
void setCheckmateFail (int pass_left)
 
template<Player P>
bool isCheckmateFail (int pass_left) const
 
bool isCheckmateFailSlow (Player P, int pass_left) const
 
void setPawnDropCheckmate ()
 
bool isPawnDropCheckmate () const
 
void setHEstimates (unsigned short p_a, unsigned short d_a, unsigned short p_d, unsigned short d_d)
 
void setCEstimates (unsigned short p, unsigned short d)
 
bool isValid () const
 
bool isInvalid () const
 
bool isNormal () const
 
bool isPass () const
 
bool isDrop () const
 
Square to () const
 
Ptype ptype () const
 
Move getMove () const
 
bool operator== (const NtesukiMove &rhs) const
 
bool operator!= (const NtesukiMove &rhs) const
 
void flagsToStream (std::ostream &os) const
 

Static Public Member Functions

static NtesukiMove INVALID ()
 

Public Attributes

unsigned short h_a_proof
 
unsigned short h_a_disproof
 
unsigned short h_d_proof
 
unsigned short h_d_disproof
 

Private Types

enum  Flags {
  NONE = 0, CHECK_FLAG = 1, PAWN_DROP_CHECKMATE_FLAG = 2, IMMEDIATE_CHECKMATE = 8,
  TO_OLDER_CHILD = 16, NOPROMOTE = 32, INTERPOSE = 64, ATTACK_FLAG = 128,
  BY_SIMULATION = 256, LAME_LONG = 512, WHITE_SHIFT = 4, IS_SUCCESS_SHIFT = 16,
  IS_SUCCESS_BLACK_SHIFT = IS_SUCCESS_SHIFT, IS_SUCCESS_WHITE_SHIFT = IS_SUCCESS_SHIFT + WHITE_SHIFT, IS_SUCCESS_BLACK_BASE = 1 << IS_SUCCESS_BLACK_SHIFT, IS_SUCCESS_WHITE_BASE = 1 << IS_SUCCESS_WHITE_SHIFT,
  IS_SUCCESS_BLACK_MASK = 0xf * IS_SUCCESS_BLACK_BASE, IS_SUCCESS_WHITE_MASK = 0xf * IS_SUCCESS_WHITE_BASE, IS_FAIL_SHIFT = 24, IS_FAIL_BLACK_SHIFT = IS_FAIL_SHIFT,
  IS_FAIL_WHITE_SHIFT = IS_FAIL_SHIFT + WHITE_SHIFT, IS_FAIL_BLACK_BASE = 1 << IS_FAIL_SHIFT, IS_FAIL_WHITE_BASE = 1 << (IS_FAIL_SHIFT + WHITE_SHIFT), IS_FAIL_BLACK_MASK = 0xf * IS_FAIL_BLACK_BASE,
  IS_FAIL_WHITE_MASK = 0xfLL * IS_FAIL_WHITE_BASE
}
 

Private Member Functions

template<Player P>
int is_success_flag (int pass_left) const
 
template<Player P>
int is_fail_flag (int pass_left) const
 

Private Attributes

osl::Move move
 
int flags
 
int order
 

Static Private Attributes

static std::string FlagsStr []
 

Friends

std::ostream & operator<< (std::ostream &os, const NtesukiMove &move)
 

Detailed Description

Move に ntesuki 探索に関する情報を加えたもの

Definition at line 18 of file ntesukiMove.h.

Member Enumeration Documentation

Enumerator
NONE 
CHECK_FLAG 
PAWN_DROP_CHECKMATE_FLAG 

If this move is a check move.

IMMEDIATE_CHECKMATE 

If this move is a pawn drop checkmate foul.

TO_OLDER_CHILD 

If this move is an immidiate checkmate.

NOPROMOTE 

If the distance of the parent is larger than the child.

INTERPOSE 

A promotable PAWN,ROOK,BISHOP move without promotion.

ATTACK_FLAG 

Aigoma.

BY_SIMULATION 

Attack move candidate.

LAME_LONG 

Value of the node after this move determined by simulation.

WHITE_SHIFT 
IS_SUCCESS_SHIFT 
IS_SUCCESS_BLACK_SHIFT 

This move leads to checkmate success.

IS_SUCCESS_WHITE_SHIFT 
IS_SUCCESS_BLACK_BASE 
IS_SUCCESS_WHITE_BASE 
IS_SUCCESS_BLACK_MASK 
IS_SUCCESS_WHITE_MASK 
IS_FAIL_SHIFT 
IS_FAIL_BLACK_SHIFT 

This move leads to checkmate fail.

IS_FAIL_WHITE_SHIFT 
IS_FAIL_BLACK_BASE 
IS_FAIL_WHITE_BASE 
IS_FAIL_BLACK_MASK 
IS_FAIL_WHITE_MASK 

Definition at line 20 of file ntesukiMove.h.

Constructor & Destructor Documentation

osl::ntesuki::NtesukiMove::NtesukiMove ( )

Definition at line 11 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::NtesukiMove ( osl::Move  m)

Definition at line 15 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::NtesukiMove ( osl::Move  m,
Flags  f 
)

Definition at line 22 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::NtesukiMove ( const NtesukiMove m)

Definition at line 29 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::~NtesukiMove ( )

Definition at line 53 of file ntesukiMove.cc.

Member Function Documentation

void osl::ntesuki::NtesukiMove::flagsToStream ( std::ostream &  os) const

Definition at line 235 of file ntesukiMove.cc.

References FlagsStr.

osl::Move osl::ntesuki::NtesukiMove::getMove ( ) const
int osl::ntesuki::NtesukiMove::getOrder ( ) const

Definition at line 83 of file ntesukiMove.cc.

References order.

Referenced by osl::ntesuki::NtesukiSearcher::selectMoveAttack().

osl::ntesuki::NtesukiMove osl::ntesuki::NtesukiMove::INVALID ( )
static
template<osl::Player P>
int osl::ntesuki::NtesukiMove::is_fail_flag ( int  pass_left) const
private

Definition at line 32 of file ntesukiMove.tcc.

References osl::BLACK, and ntesuki_assert.

template<osl::Player P>
int osl::ntesuki::NtesukiMove::is_success_flag ( int  pass_left) const
private

Definition at line 20 of file ntesukiMove.tcc.

References osl::BLACK, ntesuki_assert, and osl::WHITE.

bool osl::ntesuki::NtesukiMove::isBySimulation ( ) const

Definition at line 156 of file ntesukiMove.cc.

bool osl::ntesuki::NtesukiMove::isCheck ( ) const
template<osl::Player P>
bool osl::ntesuki::NtesukiMove::isCheckmateFail ( int  pass_left) const
bool osl::ntesuki::NtesukiMove::isCheckmateFailSlow ( Player  P,
int  pass_left 
) const

Definition at line 195 of file ntesukiMove.cc.

References osl::BLACK.

template<osl::Player P>
bool osl::ntesuki::NtesukiMove::isCheckmateSuccess ( int  pass_left) const
bool osl::ntesuki::NtesukiMove::isCheckmateSuccessSlow ( Player  P,
int  pass_left 
) const

Definition at line 186 of file ntesukiMove.cc.

References osl::BLACK.

bool osl::ntesuki::NtesukiMove::isDrop ( ) const
bool osl::ntesuki::NtesukiMove::isImmediateCheckmate ( ) const
bool osl::ntesuki::NtesukiMove::isInterpose ( ) const

Definition at line 110 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::selectMoveDefense().

bool osl::ntesuki::NtesukiMove::isInvalid ( ) const
bool osl::ntesuki::NtesukiMove::isLameLong ( ) const
bool osl::ntesuki::NtesukiMove::isNoPromote ( ) const
bool osl::ntesuki::NtesukiMove::isNormal ( ) const
bool osl::ntesuki::NtesukiMove::isPass ( ) const
bool osl::ntesuki::NtesukiMove::isPawnDropCheckmate ( ) const

Definition at line 170 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::selectMoveAttack().

bool osl::ntesuki::NtesukiMove::isToOld ( ) const

Definition at line 135 of file ntesukiMove.cc.

bool osl::ntesuki::NtesukiMove::isValid ( ) const
bool osl::ntesuki::NtesukiMove::operator!= ( const NtesukiMove rhs) const

Definition at line 228 of file ntesukiMove.cc.

References move.

osl::ntesuki::NtesukiMove osl::ntesuki::NtesukiMove::operator= ( const NtesukiMove m)

Definition at line 37 of file ntesukiMove.cc.

References flags, h_a_disproof, h_a_proof, h_d_disproof, h_d_proof, move, order, and order.

bool osl::ntesuki::NtesukiMove::operator== ( const NtesukiMove rhs) const

Definition at line 223 of file ntesukiMove.cc.

References move.

osl::Ptype osl::ntesuki::NtesukiMove::ptype ( ) const
void osl::ntesuki::NtesukiMove::setBySimulation ( )
void osl::ntesuki::NtesukiMove::setCEstimates ( unsigned short  p,
unsigned short  d 
)
void osl::ntesuki::NtesukiMove::setCheck ( )
template<osl::Player P>
template void osl::ntesuki::NtesukiMove::setCheckmateFail< WHITE > ( int  pass_left)
template<osl::Player P>
template void osl::ntesuki::NtesukiMove::setCheckmateSuccess< WHITE > ( int  pass_left)
void osl::ntesuki::NtesukiMove::setHEstimates ( unsigned short  p_a,
unsigned short  d_a,
unsigned short  p_d,
unsigned short  d_d 
)

Definition at line 176 of file ntesukiMove.cc.

template<osl::Player P>
template void osl::ntesuki::NtesukiMove::setImmediateCheckmate< WHITE > ( )
void osl::ntesuki::NtesukiMove::setInterpose ( )

Definition at line 103 of file ntesukiMove.cc.

References ntesuki_assert.

void osl::ntesuki::NtesukiMove::setLameLong ( )

Definition at line 116 of file ntesukiMove.cc.

References ntesuki_assert.

void osl::ntesuki::NtesukiMove::setNoPromote ( )

Definition at line 90 of file ntesukiMove.cc.

References ntesuki_assert.

void osl::ntesuki::NtesukiMove::setOrder ( int  o)

Definition at line 76 of file ntesukiMove.cc.

References ntesuki_assert, and order.

void osl::ntesuki::NtesukiMove::setPawnDropCheckmate ( )
void osl::ntesuki::NtesukiMove::setToOld ( )

Definition at line 129 of file ntesukiMove.cc.

osl::Square osl::ntesuki::NtesukiMove::to ( ) const

Definition at line 215 of file ntesukiMove.cc.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const NtesukiMove move 
)
friend

Member Data Documentation

int osl::ntesuki::NtesukiMove::flags
private

Definition at line 77 of file ntesukiMove.h.

Referenced by operator=(), and setImmediateCheckmate().

std::string osl::ntesuki::NtesukiMove::FlagsStr
staticprivate

Definition at line 70 of file ntesukiMove.h.

Referenced by flagsToStream().

unsigned short osl::ntesuki::NtesukiMove::h_a_disproof
unsigned short osl::ntesuki::NtesukiMove::h_a_proof
unsigned short osl::ntesuki::NtesukiMove::h_d_disproof
unsigned short osl::ntesuki::NtesukiMove::h_d_proof
osl::Move osl::ntesuki::NtesukiMove::move
private
int osl::ntesuki::NtesukiMove::order
private

Definition at line 78 of file ntesukiMove.h.

Referenced by operator=().


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