/usr/include/osl/effect_util/unblockableEffect.h is in libosl-dev 0.6.0-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 58 59 60 61 | /* unblockableEffect.h
*/
#ifndef _UNBLOCKABLEEFFECT_H
#define _UNBLOCKABLEEFFECT_H
#include "osl/state/numEffectState.h"
#include "osl/container/pieceVector.h"
#include "osl/eval/pieceEval.h"
#include "osl/boardTable.h"
#include "osl/ptypeTraits.h"
namespace osl
{
namespace effect_util
{
struct UnblockableEffect
{
/**
* from にあるptypeoからunblockableな利きで届く敵の駒を
* おいしい順にoutに格納
*/
static int find(const NumEffectState& state,
PtypeO ptypeo, Square from,
PieceVector& supported,
PieceVector& unsupported)
{
const int move_mask = Ptype_Table.getMoveMask(getPtype(ptypeo));
const Player player = getOwner(ptypeo);
const int attacker_value = abs(eval::PieceEval::captureValue(ptypeo));
for (int i=DIRECTION_MIN; i<=DIRECTION_MAX; ++i)
{
if (! (move_mask & (1<<i)))
continue;
const Direction dir = static_cast<Direction>(i);
const Square to
= Board_Table.nextSquare(player, from, dir);
const Piece target = state.pieceAt(to);
if(!target.isOnBoardByOwner(alt(player)))
continue;
if (state.hasEffectAt(alt(player), to))
{
if (abs(eval::PieceEval::captureValue(target.ptypeO()))
> attacker_value)
supported.push_back(target);
}
else
{
unsupported.push_back(target);
}
}
return attacker_value;
}
};
} // namespace effect_util
} // namespace osl
#endif /* _UNBLOCKABLEEFFECT_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
|