00001 #ifndef _NO_PROMOTE_MOVE_ACTION_H
00002 #define _NO_PROMOTE_MOVE_ACTION_H
00003
00004 #include "osl/move_action/concept.h"
00005 namespace osl
00006 {
00007 namespace effect_action
00008 {
00012 template<class State,class Action>
00013 class NoPromote
00014 {
00015 BOOST_CLASS_REQUIRE(Action,osl::move_action,Concept);
00016 private:
00017 const State& state;
00018 Action& ac;
00019 public:
00020 NoPromote(const State& s, Action & a) : state(s), ac(a){}
00021 template<Player P,Ptype Type>
00022 void doActionPtype(Piece p1,Position to){
00023 if(!p1.isPromoted())
00024 ac.unknownMove(p1.position(),to,state.getPieceAt(to),Type,false,P);
00025 }
00026 template<Player P>
00027 void doAction(Piece p1,Position to){
00028 if(!p1.isPromoted())
00029 ac.unknownMove(p1.position(),to,state.getPieceAt(to),p1.ptype(),false,P);
00030 }
00031 bool done() const{ return false;}
00032 };
00033 }
00034 }
00035 #endif // _NO_PROMOTE_MOVE_ACTION_H
00036
00037
00038
00039