checkmateGroup.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
checkmateGroup.h
Go to the documentation of this file.
1 /* checkmateGroup.h
2 */
3 #ifndef _CHECKMATEGROUP_H
4 #define _CHECKMATEGROUP_H
5
6 #include "osl/rating/group.h"
7 #include "osl/rating/feature/checkmate.h"
8
9 namespace osl
10 {
11 namespace rating
12 {
13 class CheckmateIfCaptureGroup : public Group
14 {
15 public:
16 CheckmateIfCaptureGroup() : Group("CheckmateCap")
17 {
18 for (int p=0; p<8; ++p) // progress8
19 push_back(new CheckmateIfCapture);
20 }
21 void show(std::ostream& os, int name_width, const range_t& range,
22 const vector<double>& weights) const
23 {
24 showAll(os, name_width, range, weights);
25 }
26 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
27 {
28 const int progress8 = env.progress.value()/2;
29 if ((*this)[0].match(state, move, env))
30 return progress8;
31 return -1;
32 }
33 };
34 struct ThreatmateGroup : public Group
35 {
36 ThreatmateGroup() : Group("Threatmate")
37 {
38 for (int p=0; p<8; ++p) // progress8
39 push_back(new Threatmate);
40 }
41 void show(std::ostream& os, int name_width, const range_t& range,
42 const vector<double>& weights) const
43 {
44 showAll(os, name_width, range, weights);
45 }
46 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
47 {
48 const int progress8 = env.progress.value()/2;
49 if ((*this)[0].match(state, move, env))
50 return progress8;
51 return -1;
52 }
53 };
54 }
55 } // name_width osl
56
57 #endif /* _CHECKMATEGROUP_H */
58 // ;;; Local Variables:
59 // ;;; mode:c++
60 // ;;; c-basic-offset:2
61 // ;;; End: