pieceFilter.h
Go to the documentation of this file.
00001 #ifndef _NOT_BY_ACTION_H
00002 #define _NOT_BY_ACTION_H
00003 #include "osl/piece.h"
00004 #include "osl/square.h"
00005 namespace osl
00006 {
00012   template<class Action>
00013   class PieceFilter
00014   {
00015   private:
00016     Action & ac;
00017     Piece piece;
00018   public:
00019     PieceFilter(Action & a,Piece p) :ac(a),piece(p){
00020     }
00021     template<Player P,Ptype Type>
00022     void doActionPtype(Piece p1,Square to){
00023       if(p1!=piece){
00024         ac.template doActionPtype<P,Type>(p1,to);
00025       }
00026     }
00027     template<Player P>
00028     void doAction(Piece p1,Square to){
00029       if(p1!=piece){
00030         ac.template doAction<P>(p1,to);
00031       }
00032     }
00033     bool done() const{ return ac.done(); } 
00034   };
00035 
00036 }
00037 #endif // _NOT_BY_ACTION_H
00038 // ;;; Local Variables:
00039 // ;;; mode:c++
00040 // ;;; c-basic-offset:2
00041 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines