All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pieceFilter.h
Go to the documentation of this file.
1 #ifndef _NOT_BY_ACTION_H
2 #define _NOT_BY_ACTION_H
3 #include "osl/piece.h"
4 #include "osl/square.h"
5 namespace osl
6 {
12  template<class Action>
14  {
15  private:
16  Action & ac;
18  public:
19  PieceFilter(Action & a,Piece p) :ac(a),piece(p){
20  }
21  template<Player P,Ptype Type>
22  void doActionPtype(Piece p1,Square to){
23  if(p1!=piece){
24  ac.template doActionPtype<P,Type>(p1,to);
25  }
26  }
27  template<Player P>
28  void doAction(Piece p1,Square to){
29  if(p1!=piece){
30  ac.template doAction<P>(p1,to);
31  }
32  }
33  bool done() const{ return ac.done(); }
34  };
35 
36 }
37 #endif // _NOT_BY_ACTION_H
38 // ;;; Local Variables:
39 // ;;; mode:c++
40 // ;;; c-basic-offset:2
41 // ;;; End: