ptypeTraits.h
Go to the documentation of this file.
/* ptypeTraits.h
*/
#ifndef OSL_PTYPETRAITS_H
#define OSL_PTYPETRAITS_H
#include "osl/basic_type.h"
#include "osl/bits/directionTraits.h"
namespace osl
{
template<Ptype T>
struct PtypeTraits;
template <>
struct PtypeTraits<PTYPE_EMPTY>
{
static const bool isBasic=false;
static const bool canPromote=false;
static const bool betterToPromote=false;
static const char *name() { return "PTYPE_EMPTY";}
static const char *csaName() { return "..";}
static const int moveMask=0;
};
template <>
struct PtypeTraits<PTYPE_EDGE>
{
static const bool isBasic=false;
static const bool canPromote=false;
static const bool betterToPromote=false;
static const char *name() { return "PTYPE_EDGE";}
static const char *csaName() { return "XX";}
static const int moveMask=0;
};
template <>
struct PtypeTraits<GOLD>
{
static const bool isBasic=true;
static const bool canPromote=false;
static const bool betterToPromote=false;
static const Ptype moveType=GOLD;
static const char *name() { return "GOLD";}
static const char *csaName() { return "KI";}
static const int indexMin=26;
static const int indexLimit=30;
static const int dropBlackFromY=1;
static const int dropBlackToY=9;
static const Ptype basicType=GOLD;
static const int moveMask=
DirectionTraits<UL>::mask|DirectionTraits<U>::mask
|DirectionTraits<UR>::mask|DirectionTraits<L>::mask
|DirectionTraits<R>::mask|DirectionTraits<D>::mask;
};
template <>
struct PtypeTraits<PAWN>
{
static const bool isBasic=true;
static const bool canPromote=true;
static const bool betterToPromote=true;
static const Ptype moveType=PAWN;
static const Ptype basicType=PAWN;
static const char *name() { return "PAWN";}
static const char *csaName() { return "FU";}
static const int indexMin=0;
static const int indexLimit=18;
static const int dropBlackFromY=2;
static const int dropBlackToY=9;
static const int mayPromoteToY=4;
static const int moveMask=DirectionTraits<U>::mask;
};
template <>
struct PtypeTraits<PPAWN>
{
static const bool isBasic=false;
static const bool canPromote=false;
// 疑問 falseの方がよいのでは?
static const bool betterToPromote=true;
static const Ptype moveType=GOLD;
static const char *name() { return "PPAWN";}
static const char *csaName() { return "TO";}
static const int moveMask=PtypeTraits<GOLD>::moveMask;
static const Ptype basicType=PAWN;
static const int indexMin=PtypeTraits<basicType>::indexMin;
};
template <>
struct PtypeTraits<LANCE>
{
static const bool isBasic=true;
static const bool canPromote=true;
static const bool betterToPromote=false;
static const Ptype moveType=LANCE;
static const Ptype basicType=LANCE;
static const char *name() { return "LANCE";}
static const char *csaName() { return "KY";}
static const int indexMin=32;
static const int indexLimit=36;
static const int dropBlackFromY=2;
static const int dropBlackToY=9;
static const int mayPromoteToY=9;
static const int moveMask=DirectionTraits<LONG_U>::mask;
};
template <>
struct PtypeTraits<PLANCE>
{
static const bool isBasic=false;
static const bool canPromote=false;
static const bool betterToPromote=false;
static const Ptype moveType=GOLD;
static const char *name() { return "PLANCE";}
static const char *csaName() { return "NY";}
static const int moveMask=PtypeTraits<GOLD>::moveMask;
static const Ptype basicType=LANCE;
static const int indexMin=PtypeTraits<basicType>::indexMin;
};
template <>
struct PtypeTraits<KNIGHT>
{
static const bool isBasic=true;
static const bool canPromote=true;
static const bool betterToPromote=false;
static const Ptype moveType=KNIGHT;
static const Ptype basicType=KNIGHT;
static const char *name() { return "KNIGHT";}
static const char *csaName() { return "KE";}
static const int indexMin=18;
static const int indexLimit=22;
static const int dropBlackFromY=3;
static const int dropBlackToY=9;
static const int mayPromoteToY=5;
static const int moveMask=DirectionTraits<UUL>::mask|DirectionTraits<UUR>::mask;
};
template <>
struct PtypeTraits<PKNIGHT>
{
static const bool isBasic=false;
static const bool canPromote=false;
static const bool betterToPromote=false;
static const Ptype moveType=GOLD;
static const char *name() { return "PKNIGHT";}
static const char *csaName() { return "NK";}
static const int moveMask=PtypeTraits<GOLD>::moveMask;
static const Ptype basicType=KNIGHT;
static const int indexMin=PtypeTraits<basicType>::indexMin;
};
template <>
struct PtypeTraits<SILVER>
{
static const bool isBasic=true;
static const bool canPromote=true;
static const bool betterToPromote=false;
static const Ptype moveType=SILVER;
static const Ptype basicType=SILVER;
static const char *name() { return "SILVER";}
static const char *csaName() { return "GI";}
static const int indexMin=22;
static const int indexLimit=26;
static const int dropBlackFromY=1;
static const int dropBlackToY=9;
static const int mayPromoteToY=4;
static const int moveMask=
DirectionTraits<UL>::mask|DirectionTraits<U>::mask
|DirectionTraits<UR>::mask|DirectionTraits<DL>::mask
|DirectionTraits<DR>::mask;
};
template <>
struct PtypeTraits<PSILVER>
{
static const bool isBasic=false;
static const bool canPromote=false;
static const bool betterToPromote=false;
static const Ptype moveType=GOLD;
static const char *name() { return "PSILVER";}
static const char *csaName() { return "NG";}
static const int moveMask=PtypeTraits<GOLD>::moveMask;
static const Ptype basicType=SILVER;
static const int indexMin=PtypeTraits<basicType>::indexMin;
};
template <>
struct PtypeTraits<BISHOP>
{
static const bool isBasic=true;
static const bool canPromote=true;
static const bool betterToPromote=true;
static const Ptype moveType=BISHOP;
static const Ptype basicType=BISHOP;
static const char *name() { return "BISHOP";}
static const char *csaName() { return "KA";}
static const int indexMin=36;
static const int indexLimit=38;
static const int dropBlackFromY=1;
static const int dropBlackToY=9;
static const int mayPromoteToY=9;
static const int moveMask=
DirectionTraits<LONG_UL>::mask|DirectionTraits<LONG_UR>::mask
|DirectionTraits<LONG_DL>::mask|DirectionTraits<LONG_DR>::mask;
};
template <>
struct PtypeTraits<PBISHOP>
{
static const bool isBasic=false;
static const bool canPromote=false;
// 疑問 falseの方がよいのでは?
static const bool betterToPromote=true;
static const Ptype moveType=PBISHOP;
static const char *name() { return "PBISHOP";}
static const char *csaName() { return "UM";}
static const int moveMask=
DirectionTraits<LONG_UL>::mask|DirectionTraits<LONG_UR>::mask
|DirectionTraits<LONG_DL>::mask|DirectionTraits<LONG_DR>::mask
|DirectionTraits<U>::mask|DirectionTraits<L>::mask
|DirectionTraits<R>::mask|DirectionTraits<D>::mask;
static const Ptype basicType=BISHOP;
static const int indexMin=PtypeTraits<basicType>::indexMin;
};
template <>
struct PtypeTraits<ROOK>
{
static const bool isBasic=true;
static const bool canPromote=true;
static const bool betterToPromote=true;
static const Ptype moveType=ROOK;
static const Ptype basicType=ROOK;
static const char *name() { return "ROOK";}
static const char *csaName() { return "HI";}
static const int indexMin=38;
static const int indexLimit=40;
static const int dropBlackFromY=1;
static const int dropBlackToY=9;
static const int mayPromoteToY=9;
static const int moveMask=
DirectionTraits<LONG_U>::mask|DirectionTraits<LONG_L>::mask
|DirectionTraits<LONG_R>::mask|DirectionTraits<LONG_D>::mask;
};
template <>
struct PtypeTraits<PROOK>
{
static const bool isBasic=false;
static const bool canPromote=false;
// 疑問 falseの方がよいのでは?
static const bool betterToPromote=true;
static const Ptype moveType=PROOK;
static const char *name() { return "PROOK";}
static const char *csaName() { return "RY";}
static const int moveMask=
DirectionTraits<LONG_U>::mask|DirectionTraits<LONG_L>::mask
|DirectionTraits<LONG_R>::mask|DirectionTraits<LONG_D>::mask
|DirectionTraits<UL>::mask|DirectionTraits<UR>::mask
|DirectionTraits<DL>::mask|DirectionTraits<DR>::mask;
static const Ptype basicType=ROOK;
static const int indexMin=PtypeTraits<basicType>::indexMin;
};
template <>
struct PtypeTraits<KING>
{
static const bool isBasic=true;
static const bool canPromote=false;
static const bool betterToPromote=false;
static const Ptype moveType=KING;
static const Ptype basicType=KING;
static const char *name() { return "KING";}
static const char *csaName() { return "OU";}
static const int indexMin=30;
static const int indexLimit=32;
static const int dropBlackFromY=1;
static const int dropBlackToY=9;
static const int moveMask=
DirectionTraits<U>::mask|DirectionTraits<L>::mask
|DirectionTraits<R>::mask|DirectionTraits<D>::mask
|DirectionTraits<UL>::mask|DirectionTraits<UR>::mask
|DirectionTraits<DL>::mask|DirectionTraits<DR>::mask;
};
template<Ptype T,bool IsBasic>
struct PtypeFunsSub;
template<Ptype T>
struct PtypeFunsSub<T,true>
{
static const uint64_t indexMask=(((unsigned long long) -1)<<(PtypeTraits<T>::indexMin))^(((unsigned long long) -1)<<(PtypeTraits<T>::indexLimit));
static const Ptype promotePtype=static_cast<Ptype>(static_cast<int>(T)-8);
static const Ptype basicType = T;
};
template<Ptype T>
struct PtypeFunsSub<T,false>
{
static const uint64_t indexMask=static_cast<uint64_t>(0);
// static const Ptype promotePtype=PTYPE_EMPTY;
static const Ptype promotePtype=T;
static const Ptype basicType = PtypeTraits<T>::basicType;
};
template<Ptype T>
struct PtypeFuns
{
#if OSL_WORDSIZE == 64
static const unsigned int indexNum=0;
#elif OSL_WORDSIZE == 32
static const unsigned int indexNum=(PtypeTraits<T>::indexMin >> 5);
#endif
static const bool hasLongMove=(PtypeTraits<T>::indexMin>=32);
static const uint64_t indexMask=PtypeFunsSub<T,PtypeTraits<T>::isBasic>::indexMask;
static const Ptype promotePtype=PtypeFunsSub<T,PtypeTraits<T>::canPromote>::promotePtype;
static const Ptype basicType=PtypeFunsSub<T,PtypeTraits<T>::isBasic>::basicType;
};
enum MoveConstraint {
CannotMove,
OnlyPromoted,
OnlyBasic,
NoConstraint,
};
template<Ptype T,Direction D>
struct PtypeDirectionTraits
{
static const bool hasMove=(PtypeTraits<T>::moveMask & DirectionTraits<D>::mask)!=0;
static const bool canMove=
(PtypeTraits<T>::moveMask & DirectionTraits<D>::mask)!=0 ||
(PtypeTraits<T>::moveMask &
DirectionTraits<DirectionTraits<D>::longDir>::mask)!=0;
static const MoveConstraint moveConstraint =
(PtypeDirectionTraits<T,D>::canMove
? (PtypeDirectionTraits<PtypeFuns<T>::promotePtype,D>::canMove
? NoConstraint : OnlyBasic )
: (PtypeDirectionTraits<PtypeFuns<T>::promotePtype,D>::canMove
? OnlyPromoted : CannotMove));
};
template<Player T>
struct KingTraits
{
static const int index=PtypeTraits<KING>::indexMin+playerToIndex(T);
};
template<Ptype T,Player P>
struct PtypePlayerTraits
{
static bool canDropTo(Square pos)
{
static_assert(PtypeTraits<T>::isBasic, "canDropTo");
if (PtypeTraits<T>::dropBlackFromY == 1)
return true;
if (P==BLACK)
return pos.y() >= PtypeTraits<T>::dropBlackFromY;
else
return pos.y() <= Square::reverseY(PtypeTraits<T>::dropBlackFromY);
}
static bool mayPromote(Square pos)
{
static_assert(PtypeTraits<T>::isBasic&&PtypeTraits<T>::canPromote, "mayPromote");
if (PtypeTraits<T>::mayPromoteToY == 9)
return true;
if (P==BLACK)
return pos.y() <= PtypeTraits<T>::mayPromoteToY;
else
return pos.y() >= Square::reverseY(PtypeTraits<T>::mayPromoteToY);
}
static bool mustPromote(Square pos)
{
if(P==BLACK){
if(T==PAWN || T==LANCE) return pos.yEq<2>();
else if(T==KNIGHT) return pos.yLe<4>();
else return false;
}
else{
if(T==PAWN || T==LANCE) return pos.yEq<8>();
else if(T==KNIGHT) return pos.yGe<6>();
else return false;
}
}
static bool canPromote(Square pos)
{
if(P==BLACK){
if(T==PAWN || T==LANCE) return pos.yLe<4>();
else if(T==KNIGHT) return pos.yLe<5>();
else return pos.yLe<3>();
}
else{
if(T==PAWN || T==LANCE) return pos.yGe<6>();
else if(T==KNIGHT) return pos.yGe<5>();
else return pos.yGe<7>();
}
}
static bool checkPromote(Square pos)
{
if(P==BLACK){
if(T==SILVER) return pos.yEq<4>();
else if(T==LANCE || T==ROOK || T==BISHOP)
return true;
else return false;
}
else{
if(T==SILVER) return pos.yEq<6>();
else if(T==LANCE || T==ROOK || T==BISHOP)
return true;
else return false;
}
}
static bool noPromote(Square pos)
{
if(P==BLACK){
if(T==PAWN || T==SILVER) return pos.yGe<5>();
else if(T==KNIGHT) return pos.yGe<6>();
else if(T==LANCE || T==ROOK || T==BISHOP) return false;
else return true;
}
else{
if(T==PAWN || T==SILVER) return pos.yLe<5>();
else if(T==KNIGHT) return pos.yLe<4>();
else if(T==LANCE || T==ROOK || T==BISHOP) return false;
else return true;
}
}
};
} // namespace osl
#endif /* OSL_PTYPETRAITS_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
basic_type.h
osl::Square
Definition basic_type.h:532
osl::Square::yGe
std::enable_if< Y!=7, bool >::type yGe()
Definition basic_type.h:738
osl::Square::yEq
bool yEq()
Definition basic_type.h:726
osl::Square::y
int y() const
将棋としてのY座標を返す.
Definition basic_type.h:567
osl::Square::reverseY
static int reverseY(int y)
Definition basic_type.h:652
osl::Square::yLe
std::enable_if< Y!=2, bool >::type yLe()
Definition basic_type.h:730
directionTraits.h
osl
Definition additionalEffect.h:6
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::ROOK
@ ROOK
Definition basic_type.h:100
osl::PPAWN
@ PPAWN
Definition basic_type.h:87
osl::BISHOP
@ BISHOP
Definition basic_type.h:99
osl::PROOK
@ PROOK
Definition basic_type.h:92
osl::PAWN
@ PAWN
Definition basic_type.h:95
osl::PTYPE_EDGE
@ PTYPE_EDGE
Definition basic_type.h:86
osl::KING
@ KING
Definition basic_type.h:93
osl::KNIGHT
@ KNIGHT
Definition basic_type.h:97
osl::PTYPE_EMPTY
@ PTYPE_EMPTY
Definition basic_type.h:85
osl::SILVER
@ SILVER
Definition basic_type.h:98
osl::PKNIGHT
@ PKNIGHT
Definition basic_type.h:89
osl::GOLD
@ GOLD
Definition basic_type.h:94
osl::PLANCE
@ PLANCE
Definition basic_type.h:88
osl::PBISHOP
@ PBISHOP
Definition basic_type.h:91
osl::LANCE
@ LANCE
Definition basic_type.h:96
osl::PSILVER
@ PSILVER
Definition basic_type.h:90
osl::playerToIndex
constexpr int playerToIndex(Player player)
Definition basic_type.h:16
osl::D
@ D
Definition basic_type.h:319
osl::BLACK
@ BLACK
Definition basic_type.h:9
osl::MoveConstraint
MoveConstraint
ある方向にある駒が移動可能かを表す.
Definition ptypeTraits.h:327
osl::NoConstraint
@ NoConstraint
promoteしていようが，いまいが可能
Definition ptypeTraits.h:335
osl::OnlyBasic
@ OnlyBasic
promoteしていない駒の場合にのみ可能
Definition ptypeTraits.h:333
osl::OnlyPromoted
@ OnlyPromoted
promote済みの駒の場合にのみ可能
Definition ptypeTraits.h:331
osl::CannotMove
@ CannotMove
可能でない
Definition ptypeTraits.h:329
osl::DirectionTraits
Definition directionTraits.h:225
osl::DirectionTraits::mask
static const unsigned int mask
Definition directionTraits.h:227
osl::DirectionTraits::longDir
static const Direction longDir
Definition directionTraits.h:233
osl::KingTraits
Definition ptypeTraits.h:357
osl::KingTraits::index
static const int index
Definition ptypeTraits.h:358
osl::PtypeDirectionTraits
Definition ptypeTraits.h:340
osl::PtypeDirectionTraits::hasMove
static const bool hasMove
Definition ptypeTraits.h:341
osl::PtypeDirectionTraits::canMove
static const bool canMove
Definition ptypeTraits.h:342
osl::PtypeDirectionTraits::moveConstraint
static const MoveConstraint moveConstraint
Definition ptypeTraits.h:346
osl::PtypeFunsSub< T, false >::promotePtype
static const Ptype promotePtype
Definition ptypeTraits.h:305
osl::PtypeFunsSub< T, false >::indexMask
static const uint64_t indexMask
Definition ptypeTraits.h:303
osl::PtypeFunsSub< T, false >::basicType
static const Ptype basicType
Definition ptypeTraits.h:306
osl::PtypeFunsSub< T, true >::basicType
static const Ptype basicType
Definition ptypeTraits.h:297
osl::PtypeFunsSub< T, true >::indexMask
static const uint64_t indexMask
Definition ptypeTraits.h:295
osl::PtypeFunsSub< T, true >::promotePtype
static const Ptype promotePtype
Definition ptypeTraits.h:296
osl::PtypeFunsSub
Definition ptypeTraits.h:290
osl::PtypeFuns
Definition ptypeTraits.h:311
osl::PtypeFuns::promotePtype
static const Ptype promotePtype
Definition ptypeTraits.h:319
osl::PtypeFuns::basicType
static const Ptype basicType
Definition ptypeTraits.h:320
osl::PtypeFuns::indexMask
static const uint64_t indexMask
Definition ptypeTraits.h:318
osl::PtypeFuns::hasLongMove
static const bool hasLongMove
Definition ptypeTraits.h:317
osl::PtypePlayerTraits
Definition ptypeTraits.h:363
osl::PtypePlayerTraits::canDropTo
static bool canDropTo(Square pos)
Definition ptypeTraits.h:364
osl::PtypePlayerTraits::checkPromote
static bool checkPromote(Square pos)
posにあるTの駒がpromote可能なdirectionに動く時だけpromote可能 shortの時はその時のみYES
Definition ptypeTraits.h:426
osl::PtypePlayerTraits::canPromote
static bool canPromote(Square pos)
posにあるTの駒がどの方向に動いてもpromote可能
Definition ptypeTraits.h:409
osl::PtypePlayerTraits::mayPromote
static bool mayPromote(Square pos)
posにある駒がpromoteする可能性があるか?
Definition ptypeTraits.h:379
osl::PtypePlayerTraits::noPromote
static bool noPromote(Square pos)
posにあるTの駒は次に絶対にpromoteできない
Definition ptypeTraits.h:444
osl::PtypePlayerTraits::mustPromote
static bool mustPromote(Square pos)
posにあるTの駒がpromoteする手しかない
Definition ptypeTraits.h:393
osl::PtypeTraits< BISHOP >::canPromote
static const bool canPromote
Definition ptypeTraits.h:193
osl::PtypeTraits< BISHOP >::indexMin
static const int indexMin
Definition ptypeTraits.h:199
osl::PtypeTraits< BISHOP >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:200
osl::PtypeTraits< BISHOP >::name
static const char * name()
Definition ptypeTraits.h:197
osl::PtypeTraits< BISHOP >::isBasic
static const bool isBasic
Definition ptypeTraits.h:192
osl::PtypeTraits< BISHOP >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:194
osl::PtypeTraits< BISHOP >::basicType
static const Ptype basicType
Definition ptypeTraits.h:196
osl::PtypeTraits< BISHOP >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:201
osl::PtypeTraits< BISHOP >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:202
osl::PtypeTraits< BISHOP >::moveMask
static const int moveMask
Definition ptypeTraits.h:204
osl::PtypeTraits< BISHOP >::csaName
static const char * csaName()
Definition ptypeTraits.h:198
osl::PtypeTraits< BISHOP >::moveType
static const Ptype moveType
Definition ptypeTraits.h:195
osl::PtypeTraits< BISHOP >::mayPromoteToY
static const int mayPromoteToY
Definition ptypeTraits.h:203
osl::PtypeTraits< GOLD >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:48
osl::PtypeTraits< GOLD >::basicType
static const Ptype basicType
Definition ptypeTraits.h:50
osl::PtypeTraits< GOLD >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:42
osl::PtypeTraits< GOLD >::moveMask
static const int moveMask
Definition ptypeTraits.h:51
osl::PtypeTraits< GOLD >::moveType
static const Ptype moveType
Definition ptypeTraits.h:43
osl::PtypeTraits< GOLD >::canPromote
static const bool canPromote
Definition ptypeTraits.h:41
osl::PtypeTraits< GOLD >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:49
osl::PtypeTraits< GOLD >::csaName
static const char * csaName()
Definition ptypeTraits.h:45
osl::PtypeTraits< GOLD >::indexMin
static const int indexMin
Definition ptypeTraits.h:46
osl::PtypeTraits< GOLD >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:47
osl::PtypeTraits< GOLD >::isBasic
static const bool isBasic
Definition ptypeTraits.h:40
osl::PtypeTraits< GOLD >::name
static const char * name()
Definition ptypeTraits.h:44
osl::PtypeTraits< KING >::moveType
static const Ptype moveType
Definition ptypeTraits.h:274
osl::PtypeTraits< KING >::name
static const char * name()
Definition ptypeTraits.h:276
osl::PtypeTraits< KING >::basicType
static const Ptype basicType
Definition ptypeTraits.h:275
osl::PtypeTraits< KING >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:279
osl::PtypeTraits< KING >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:280
osl::PtypeTraits< KING >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:281
osl::PtypeTraits< KING >::indexMin
static const int indexMin
Definition ptypeTraits.h:278
osl::PtypeTraits< KING >::isBasic
static const bool isBasic
Definition ptypeTraits.h:271
osl::PtypeTraits< KING >::csaName
static const char * csaName()
Definition ptypeTraits.h:277
osl::PtypeTraits< KING >::moveMask
static const int moveMask
Definition ptypeTraits.h:282
osl::PtypeTraits< KING >::canPromote
static const bool canPromote
Definition ptypeTraits.h:272
osl::PtypeTraits< KING >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:273
osl::PtypeTraits< KNIGHT >::isBasic
static const bool isBasic
Definition ptypeTraits.h:125
osl::PtypeTraits< KNIGHT >::csaName
static const char * csaName()
Definition ptypeTraits.h:131
osl::PtypeTraits< KNIGHT >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:134
osl::PtypeTraits< KNIGHT >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:127
osl::PtypeTraits< KNIGHT >::canPromote
static const bool canPromote
Definition ptypeTraits.h:126
osl::PtypeTraits< KNIGHT >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:133
osl::PtypeTraits< KNIGHT >::name
static const char * name()
Definition ptypeTraits.h:130
osl::PtypeTraits< KNIGHT >::moveMask
static const int moveMask
Definition ptypeTraits.h:137
osl::PtypeTraits< KNIGHT >::basicType
static const Ptype basicType
Definition ptypeTraits.h:129
osl::PtypeTraits< KNIGHT >::indexMin
static const int indexMin
Definition ptypeTraits.h:132
osl::PtypeTraits< KNIGHT >::mayPromoteToY
static const int mayPromoteToY
Definition ptypeTraits.h:136
osl::PtypeTraits< KNIGHT >::moveType
static const Ptype moveType
Definition ptypeTraits.h:128
osl::PtypeTraits< KNIGHT >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:135
osl::PtypeTraits< LANCE >::basicType
static const Ptype basicType
Definition ptypeTraits.h:97
osl::PtypeTraits< LANCE >::mayPromoteToY
static const int mayPromoteToY
Definition ptypeTraits.h:104
osl::PtypeTraits< LANCE >::indexMin
static const int indexMin
Definition ptypeTraits.h:100
osl::PtypeTraits< LANCE >::moveType
static const Ptype moveType
Definition ptypeTraits.h:96
osl::PtypeTraits< LANCE >::isBasic
static const bool isBasic
Definition ptypeTraits.h:93
osl::PtypeTraits< LANCE >::csaName
static const char * csaName()
Definition ptypeTraits.h:99
osl::PtypeTraits< LANCE >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:101
osl::PtypeTraits< LANCE >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:102
osl::PtypeTraits< LANCE >::name
static const char * name()
Definition ptypeTraits.h:98
osl::PtypeTraits< LANCE >::canPromote
static const bool canPromote
Definition ptypeTraits.h:94
osl::PtypeTraits< LANCE >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:95
osl::PtypeTraits< LANCE >::moveMask
static const int moveMask
Definition ptypeTraits.h:105
osl::PtypeTraits< LANCE >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:103
osl::PtypeTraits< PAWN >::indexMin
static const int indexMin
Definition ptypeTraits.h:67
osl::PtypeTraits< PAWN >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:70
osl::PtypeTraits< PAWN >::moveMask
static const int moveMask
Definition ptypeTraits.h:72
osl::PtypeTraits< PAWN >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:69
osl::PtypeTraits< PAWN >::basicType
static const Ptype basicType
Definition ptypeTraits.h:64
osl::PtypeTraits< PAWN >::mayPromoteToY
static const int mayPromoteToY
Definition ptypeTraits.h:71
osl::PtypeTraits< PAWN >::isBasic
static const bool isBasic
Definition ptypeTraits.h:60
osl::PtypeTraits< PAWN >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:68
osl::PtypeTraits< PAWN >::moveType
static const Ptype moveType
Definition ptypeTraits.h:63
osl::PtypeTraits< PAWN >::csaName
static const char * csaName()
Definition ptypeTraits.h:66
osl::PtypeTraits< PAWN >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:62
osl::PtypeTraits< PAWN >::canPromote
static const bool canPromote
Definition ptypeTraits.h:61
osl::PtypeTraits< PAWN >::name
static const char * name()
Definition ptypeTraits.h:65
osl::PtypeTraits< PBISHOP >::csaName
static const char * csaName()
Definition ptypeTraits.h:218
osl::PtypeTraits< PBISHOP >::basicType
static const Ptype basicType
Definition ptypeTraits.h:224
osl::PtypeTraits< PBISHOP >::indexMin
static const int indexMin
Definition ptypeTraits.h:225
osl::PtypeTraits< PBISHOP >::canPromote
static const bool canPromote
Definition ptypeTraits.h:213
osl::PtypeTraits< PBISHOP >::isBasic
static const bool isBasic
Definition ptypeTraits.h:212
osl::PtypeTraits< PBISHOP >::name
static const char * name()
Definition ptypeTraits.h:217
osl::PtypeTraits< PBISHOP >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:215
osl::PtypeTraits< PBISHOP >::moveType
static const Ptype moveType
Definition ptypeTraits.h:216
osl::PtypeTraits< PBISHOP >::moveMask
static const int moveMask
Definition ptypeTraits.h:219
osl::PtypeTraits< PKNIGHT >::basicType
static const Ptype basicType
Definition ptypeTraits.h:150
osl::PtypeTraits< PKNIGHT >::csaName
static const char * csaName()
Definition ptypeTraits.h:148
osl::PtypeTraits< PKNIGHT >::moveMask
static const int moveMask
Definition ptypeTraits.h:149
osl::PtypeTraits< PKNIGHT >::canPromote
static const bool canPromote
Definition ptypeTraits.h:144
osl::PtypeTraits< PKNIGHT >::isBasic
static const bool isBasic
Definition ptypeTraits.h:143
osl::PtypeTraits< PKNIGHT >::name
static const char * name()
Definition ptypeTraits.h:147
osl::PtypeTraits< PKNIGHT >::indexMin
static const int indexMin
Definition ptypeTraits.h:151
osl::PtypeTraits< PKNIGHT >::moveType
static const Ptype moveType
Definition ptypeTraits.h:146
osl::PtypeTraits< PKNIGHT >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:145
osl::PtypeTraits< PLANCE >::isBasic
static const bool isBasic
Definition ptypeTraits.h:111
osl::PtypeTraits< PLANCE >::moveMask
static const int moveMask
Definition ptypeTraits.h:117
osl::PtypeTraits< PLANCE >::name
static const char * name()
Definition ptypeTraits.h:115
osl::PtypeTraits< PLANCE >::csaName
static const char * csaName()
Definition ptypeTraits.h:116
osl::PtypeTraits< PLANCE >::indexMin
static const int indexMin
Definition ptypeTraits.h:119
osl::PtypeTraits< PLANCE >::basicType
static const Ptype basicType
Definition ptypeTraits.h:118
osl::PtypeTraits< PLANCE >::canPromote
static const bool canPromote
Definition ptypeTraits.h:112
osl::PtypeTraits< PLANCE >::moveType
static const Ptype moveType
Definition ptypeTraits.h:114
osl::PtypeTraits< PLANCE >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:113
osl::PtypeTraits< PPAWN >::canPromote
static const bool canPromote
Definition ptypeTraits.h:79
osl::PtypeTraits< PPAWN >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:81
osl::PtypeTraits< PPAWN >::csaName
static const char * csaName()
Definition ptypeTraits.h:84
osl::PtypeTraits< PPAWN >::basicType
static const Ptype basicType
Definition ptypeTraits.h:86
osl::PtypeTraits< PPAWN >::name
static const char * name()
Definition ptypeTraits.h:83
osl::PtypeTraits< PPAWN >::moveType
static const Ptype moveType
Definition ptypeTraits.h:82
osl::PtypeTraits< PPAWN >::isBasic
static const bool isBasic
Definition ptypeTraits.h:78
osl::PtypeTraits< PPAWN >::indexMin
static const int indexMin
Definition ptypeTraits.h:87
osl::PtypeTraits< PPAWN >::moveMask
static const int moveMask
Definition ptypeTraits.h:85
osl::PtypeTraits< PROOK >::moveMask
static const int moveMask
Definition ptypeTraits.h:258
osl::PtypeTraits< PROOK >::name
static const char * name()
Definition ptypeTraits.h:256
osl::PtypeTraits< PROOK >::isBasic
static const bool isBasic
Definition ptypeTraits.h:251
osl::PtypeTraits< PROOK >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:254
osl::PtypeTraits< PROOK >::canPromote
static const bool canPromote
Definition ptypeTraits.h:252
osl::PtypeTraits< PROOK >::csaName
static const char * csaName()
Definition ptypeTraits.h:257
osl::PtypeTraits< PROOK >::indexMin
static const int indexMin
Definition ptypeTraits.h:264
osl::PtypeTraits< PROOK >::basicType
static const Ptype basicType
Definition ptypeTraits.h:263
osl::PtypeTraits< PROOK >::moveType
static const Ptype moveType
Definition ptypeTraits.h:255
osl::PtypeTraits< PSILVER >::csaName
static const char * csaName()
Definition ptypeTraits.h:183
osl::PtypeTraits< PSILVER >::moveType
static const Ptype moveType
Definition ptypeTraits.h:181
osl::PtypeTraits< PSILVER >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:180
osl::PtypeTraits< PSILVER >::moveMask
static const int moveMask
Definition ptypeTraits.h:184
osl::PtypeTraits< PSILVER >::name
static const char * name()
Definition ptypeTraits.h:182
osl::PtypeTraits< PSILVER >::indexMin
static const int indexMin
Definition ptypeTraits.h:186
osl::PtypeTraits< PSILVER >::basicType
static const Ptype basicType
Definition ptypeTraits.h:185
osl::PtypeTraits< PSILVER >::canPromote
static const bool canPromote
Definition ptypeTraits.h:179
osl::PtypeTraits< PSILVER >::isBasic
static const bool isBasic
Definition ptypeTraits.h:178
osl::PtypeTraits< PTYPE_EDGE >::canPromote
static const bool canPromote
Definition ptypeTraits.h:30
osl::PtypeTraits< PTYPE_EDGE >::isBasic
static const bool isBasic
Definition ptypeTraits.h:29
osl::PtypeTraits< PTYPE_EDGE >::moveMask
static const int moveMask
Definition ptypeTraits.h:34
osl::PtypeTraits< PTYPE_EDGE >::csaName
static const char * csaName()
Definition ptypeTraits.h:33
osl::PtypeTraits< PTYPE_EDGE >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:31
osl::PtypeTraits< PTYPE_EDGE >::name
static const char * name()
Definition ptypeTraits.h:32
osl::PtypeTraits< PTYPE_EMPTY >::canPromote
static const bool canPromote
Definition ptypeTraits.h:18
osl::PtypeTraits< PTYPE_EMPTY >::name
static const char * name()
Definition ptypeTraits.h:21
osl::PtypeTraits< PTYPE_EMPTY >::betterToPromote
static const bool betterToPromote
打ち歩詰を除いて考えると promoteは常に得
Definition ptypeTraits.h:20
osl::PtypeTraits< PTYPE_EMPTY >::csaName
static const char * csaName()
Definition ptypeTraits.h:22
osl::PtypeTraits< PTYPE_EMPTY >::moveMask
static const int moveMask
Definition ptypeTraits.h:23
osl::PtypeTraits< PTYPE_EMPTY >::isBasic
static const bool isBasic
Definition ptypeTraits.h:17
osl::PtypeTraits< ROOK >::basicType
static const Ptype basicType
Definition ptypeTraits.h:235
osl::PtypeTraits< ROOK >::moveType
static const Ptype moveType
Definition ptypeTraits.h:234
osl::PtypeTraits< ROOK >::indexMin
static const int indexMin
Definition ptypeTraits.h:238
osl::PtypeTraits< ROOK >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:233
osl::PtypeTraits< ROOK >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:239
osl::PtypeTraits< ROOK >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:241
osl::PtypeTraits< ROOK >::moveMask
static const int moveMask
Definition ptypeTraits.h:243
osl::PtypeTraits< ROOK >::name
static const char * name()
Definition ptypeTraits.h:236
osl::PtypeTraits< ROOK >::mayPromoteToY
static const int mayPromoteToY
Definition ptypeTraits.h:242
osl::PtypeTraits< ROOK >::csaName
static const char * csaName()
Definition ptypeTraits.h:237
osl::PtypeTraits< ROOK >::canPromote
static const bool canPromote
Definition ptypeTraits.h:232
osl::PtypeTraits< ROOK >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:240
osl::PtypeTraits< ROOK >::isBasic
static const bool isBasic
Definition ptypeTraits.h:231
osl::PtypeTraits< SILVER >::betterToPromote
static const bool betterToPromote
Definition ptypeTraits.h:159
osl::PtypeTraits< SILVER >::canPromote
static const bool canPromote
Definition ptypeTraits.h:158
osl::PtypeTraits< SILVER >::mayPromoteToY
static const int mayPromoteToY
Definition ptypeTraits.h:168
osl::PtypeTraits< SILVER >::isBasic
static const bool isBasic
Definition ptypeTraits.h:157
osl::PtypeTraits< SILVER >::moveType
static const Ptype moveType
Definition ptypeTraits.h:160
osl::PtypeTraits< SILVER >::csaName
static const char * csaName()
Definition ptypeTraits.h:163
osl::PtypeTraits< SILVER >::basicType
static const Ptype basicType
Definition ptypeTraits.h:161
osl::PtypeTraits< SILVER >::indexLimit
static const int indexLimit
Definition ptypeTraits.h:165
osl::PtypeTraits< SILVER >::indexMin
static const int indexMin
Definition ptypeTraits.h:164
osl::PtypeTraits< SILVER >::dropBlackToY
static const int dropBlackToY
Definition ptypeTraits.h:167
osl::PtypeTraits< SILVER >::moveMask
static const int moveMask
Definition ptypeTraits.h:169
osl::PtypeTraits< SILVER >::name
static const char * name()
Definition ptypeTraits.h:162
osl::PtypeTraits< SILVER >::dropBlackFromY
static const int dropBlackFromY
Definition ptypeTraits.h:166
osl::PtypeTraits
Definition ptypeTraits.h:12