/usr/include/osl/ntesuki/ntesukiMove.h is in libosl-dev 0.6.0-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | /* ntesukiMove.h
*/
#ifndef _NTESUKIMOVE_H
#define _NTESUKIMOVE_H
#include "osl/move.h"
#include "osl/ntesuki/ntesukiExceptions.h"
namespace osl
{
namespace ntesuki
{
/**
* Move に ntesuki 探索に関する情報を加えたもの
*
* - flag にノードの状態を保持するようにした
*/
class NtesukiMove
{
enum Flags
{
NONE = 0,
/* 2^0 */
CHECK_FLAG = 1, /** If this move is a check move. */
/* 2^1 */
PAWN_DROP_CHECKMATE_FLAG = 2, /** If this move is a pawn drop checkmate foul. */
/* 2^2 */
/* 4 not used */
/* 2^3 */
IMMEDIATE_CHECKMATE = 8, /** If this move is an immidiate checkmate. */
/* 2^4 */
TO_OLDER_CHILD = 16, /** If the distance of the parent is larger than the child */
/* 2^5 */
NOPROMOTE = 32, /** A promotable PAWN,ROOK,BISHOP move without promotion */
/* 2^6 */
INTERPOSE = 64, /** Aigoma */
/* 2^7 */
ATTACK_FLAG = 128, /** Attack move candidate */
/* 2^8 */
BY_SIMULATION = 256, /** Value of the node after this move determined by simulation */
/* 2^9 */
LAME_LONG = 512,
/* 2^10 */
/* 2^11 */
/* 2^12 */
/* 2^13 */
/* 2^14 */
/* 2^15 */
WHITE_SHIFT = 4,
IS_SUCCESS_SHIFT = 16, /** This move leads to checkmate success. */
/* 16-19 BLACK SUCCESS */
IS_SUCCESS_BLACK_SHIFT = IS_SUCCESS_SHIFT,
/* 20-23 WHITE SUCCESS */
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, /** This move leads to checkmate fail. */
/* 24-27 BLACK FAIL */
IS_FAIL_BLACK_SHIFT = IS_FAIL_SHIFT,
/* 28-31 WHITE FAIL */
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,
};
static std::string FlagsStr[];
template <Player P>
int is_success_flag(int pass_left) const;
template <Player P>
int is_fail_flag(int pass_left) const;
osl::Move move;
int flags;
int order;
public:
unsigned short h_a_proof, h_a_disproof; // 4 byte
unsigned short h_d_proof, h_d_disproof; // 4 byte
public:
NtesukiMove();
NtesukiMove(osl::Move m);
NtesukiMove(osl::Move m, Flags f);
NtesukiMove(const NtesukiMove&);
~NtesukiMove();
NtesukiMove operator=(const NtesukiMove&);
/* static methods */
static NtesukiMove INVALID();
/* about the state of the node
*/
/* if it is a check move */
void setCheck();
bool isCheck() const;
/* if it is a check move */
void setOrder(int o);
int getOrder() const;
/* interpose */
void setInterpose();
bool isInterpose() const;
/* long move with no specific meaning */
void setLameLong();
bool isLameLong() const;
/* by simulation */
void setBySimulation();
bool isBySimulation() const;
/* nopromote */
void setNoPromote();
bool isNoPromote() const;
/* if it is a move to an child with less depth */
void setToOld();
bool isToOld() const;
/* if it is a immidiate checkmate move */
template<Player P>
void setImmediateCheckmate();
bool isImmediateCheckmate() const;
/* if it is a success/fail move */
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;
/* if it is a pawn drop checkmate move */
void setPawnDropCheckmate();
bool isPawnDropCheckmate() const;
/* estimates used before the node after the move is expanded */
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);
/* about the move itself */
bool isValid() const;
bool isInvalid() const;
bool isNormal() const;
bool isPass() const;
bool isDrop() const;
Square to() const;
Ptype ptype() const;
Move getMove() const;
/* equality, only the equality of the move is checked
* (the flags are not considered) */
bool operator==(const NtesukiMove& rhs) const;
bool operator!=(const NtesukiMove& rhs) const;
/* output to stream */
void flagsToStream(std::ostream& os) const;
friend std::ostream& operator<<(std::ostream& os, const NtesukiMove& move);
};
}// ntesuki
}// osl
#endif /* _NTESUKIMOVE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; coding:utf-8
// ;;; End:
|