/usr/include/osl/checkmate/pawnCheckmateMoves.h is in libosl-dev 0.6.0-3.3.
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 | /* pawnCheckmateMoves.h
*/
#ifndef _PAWNCHECKMATEMOVES_H
#define _PAWNCHECKMATEMOVES_H
#include "osl/move.h"
namespace osl
{
namespace checkmate
{
struct PawnCheckmateMoves
{
/**
* 指手は打歩詰の時以外は試さなくて良い
* TODO: 敵陣2段目の香も打歩詰以外は成るべき
*/
template <Player P>
static bool effectiveOnlyIfPawnCheckmate(Ptype ptype,
Square from, Square to)
{
return ((ptype == PAWN) || (ptype == ROOK) || (ptype == BISHOP))
&& (from.canPromote<P>() || to.canPromote<P>());
}
static bool effectiveOnlyIfPawnCheckmate(Player a, Ptype ptype,
Square from, Square to)
{
return ((ptype == PAWN) || (ptype == ROOK) || (ptype == BISHOP))
&& (from.canPromote(a) || to.canPromote(a));
}
static bool effectiveOnlyIfPawnCheckmate(Move m)
{
return effectiveOnlyIfPawnCheckmate(m.player(), m.ptype(),
m.from(), m.to());
}
static bool hasParingNoPromote(bool isPromote, Ptype ptype)
{
return isPromote
&& ((ptype == PPAWN) || (ptype == PROOK) || (ptype == PBISHOP));
}
/**
* m を不成にした指手は打歩詰の時以外は試さなくて良い.
* m を不成にした指手が王手とは限らない
*/
static bool hasParingNoPromote(Move m)
{
return hasParingNoPromote(m.isPromotion(), m.ptype());
}
};
} // namespace checkmate
} // namespace osl
#endif /* _PAWNCHECKMATEMOVES_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
|