All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
patternGroup.h
Go to the documentation of this file.
1 /* patternGroup.h
2  */
3 #ifndef _PATTERNGROUP_H
4 #define _PATTERNGROUP_H
5 
6 #include "osl/rating/group.h"
8 
9 namespace osl
10 {
11  namespace rating
12  {
13  struct PatternGroup : public Group
14  {
15  static std::string name(Direction direction, Direction direction2);
17  CArray2d<unsigned char, 2, Square::SIZE> target_table;
19  void show(std::ostream& os, int name_width, const range_t& range,
20  const vector<double>& weights) const
21  {
22  showTopN(os, name_width, range, weights, 3);
23  }
24  int findMatch(const NumEffectState& state, Move m, const RatingEnv&) const;
25  bool effectiveInCheck() const { return true; }
26  };
27 
28 
29  class PatternLongGroup : public Group
30  {
31  public:
32  static const CArray<Direction,4> rook_direction4;
33  static const CArray<Direction,4> bishop_direction4;
34  private:
35  static std::string name(int direction_id);
37  public:
38  explicit PatternLongGroup(int d);
39 
41  {
43  }
44  void show(std::ostream& os, int name_width, const range_t& range,
45  const vector<double>& weights) const
46  {
47  showTopN(os, name_width, range, weights, 3);
48  }
49  int findMatch(const NumEffectState& state, Move m, const RatingEnv& env) const;
50  bool effectiveInCheck() const { return true; }
51  };
52 
53 
54  class PatternLongGroup2 : public Group
55  {
56  static std::string name(int direction_id);
58  public:
59  PatternLongGroup2(int d);
60 
62  {
63  return (unpromote(ptype) == BISHOP)
66  }
67  void show(std::ostream& os, int name_width, const range_t& range,
68  const vector<double>& weights) const
69  {
70  showTopN(os, name_width, range, weights, 3);
71  }
72  int findMatch(const NumEffectState& state, Move m, const RatingEnv& env) const;
73  bool effectiveInCheck() const { return true; }
74  };
75 
76  class PatternBlockGroup : public Group
77  {
79  public:
81  void show(std::ostream& os, int name_width, const range_t& range,
82  const vector<double>& weights) const
83  {
84  showTopN(os, name_width, range, weights, 3);
85  }
86  int findMatch(const NumEffectState& state, Move m, const RatingEnv& env) const;
87  };
88  }
89 }
90 
91 #endif /* _PATTERNGROUP_H */
92 // ;;; Local Variables:
93 // ;;; mode:c++
94 // ;;; c-basic-offset:2
95 // ;;; End: