/usr/include/osl/effect_util/additionalOrShadow.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 | /* additionalOrShadow.h
*/
#ifndef OSL_ADDITIONALORSHADOW_H
#define OSL_ADDITIONALORSHADOW_H
#include "osl/state/numEffectState.h"
#include "osl/boardTable.h"
#include "osl/container/pieceVector.h"
#include <boost/foreach.hpp>
namespace osl
{
namespace effect_util
{
struct AdditionalOrShadow
{
template <int count_max>
static int count(const PieceVector& direct_pieces,
const NumEffectState& state,
Square target, Player attack)
{
int result=0;
BOOST_FOREACH(Piece p, direct_pieces)
{
const Square from = p.square();
int num = p.number();
const Direction long_d=Board_Table.getLongDirection<BLACK>(Offset32(target,from));
if(!isLong(long_d)) continue; // unpromoted Knightを除いておくのとどちらが得か?
Direction d=longToShort(long_d);
for(;;){
num=state.longEffectNumTable()[num][d];
if(Piece::isEmptyNum(num) || state.pieceOf(num).owner()!=attack)
break;
if (++result >= count_max)
return result;
}
}
return result;
}
};
}
} // namespace osl
#endif /* OSL_ADDITIONALORSHADOW_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; coding:utf-8
// ;;; End:
|