/usr/include/osl/effect_action/simpleMove.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 58 59 60 61 62 63 64 65 66 67 | #ifndef _SIMPLE_ALWAYS_MOVE_ACTION_H
#define _SIMPLE_ALWAYS_MOVE_ACTION_H
#include "osl/piece.h"
#include "osl/square.h"
#include "osl/move_action/concept.h"
namespace osl
{
namespace effect_action
{
/**
* 駒を取らないことが前提
*/
template <class Action>
class SimpleMove
{
BOOST_CLASS_REQUIRE(Action,osl::move_action,Concept);
private:
Action & ac;
public:
SimpleMove(Action & a) :ac(a){}
template<Player P,Ptype Type>
void doActionPtype(Piece p1,Square to){
Square from=p1.square();
if(canPromote(Type) &&
!p1.isPromotedNotKingGold() &&
(to.canPromote<P>() || from.canPromote<P>())){
ac.simpleMove(from,to,promote(Type),true,P);
}
if(!canPromote(Type) ||
PtypePlayerTraits<Type,P>::canDropTo(to) ||
p1.isPromotedNotKingGold()){
ac.simpleMove(from,to,p1.ptype(),false,P);
}
}
template<Player P>
void doAction(Piece p1,Square to){
Square from=p1.square();
Ptype ptype=p1.ptype();
if(canPromote(ptype)){
if (to.canPromote<P>()){
ac.simpleMove(from,to,promote(ptype),true,P);
if(Ptype_Table.canDropTo(P, ptype,to)){
ac.simpleMove(from,to,ptype,false,P);
}
}
else if (from.canPromote<P>()){
ac.simpleMove(from,to,promote(ptype),true,P);
ac.simpleMove(from,to,ptype,false,P);
}
else{
ac.simpleMove(from,to,ptype,false,P);
}
}
else{
ac.simpleMove(from,to,ptype,false,P);
}
}
bool done() const{ return false;}
};
} // namespace effect_action
} // namespace osl
#endif
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
|