00001
00002
00003 #ifndef _CHECKMATEGROUP_H
00004 #define _CHECKMATEGROUP_H
00005
00006 #include "osl/rating/group.h"
00007 #include "osl/rating/feature/checkmate.h"
00008
00009 namespace osl
00010 {
00011 namespace rating
00012 {
00013 struct CheckmateIfCaptureGroup : public Group
00014 {
00015 CheckmateIfCaptureGroup() : Group("CheckmateCap")
00016 {
00017 for (int p=0; p<8; ++p)
00018 push_back(new CheckmateIfCapture);
00019 }
00020 void show(std::ostream& os, int name_width, const range_t& range,
00021 const vector<double>& weights) const
00022 {
00023 showAll(os, name_width, range, weights);
00024 }
00025 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
00026 {
00027 const int progress8 = env.progress.value()/2;
00028 if ((*this)[0].match(state, move, env))
00029 return progress8;
00030 return -1;
00031 }
00032 };
00033 struct ThreatmateGroup : public Group
00034 {
00035 ThreatmateGroup() : Group("Threatmate")
00036 {
00037 for (int p=0; p<8; ++p)
00038 push_back(new Threatmate);
00039 }
00040 void show(std::ostream& os, int name_width, const range_t& range,
00041 const vector<double>& weights) const
00042 {
00043 showAll(os, name_width, range, weights);
00044 }
00045 int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
00046 {
00047 const int progress8 = env.progress.value()/2;
00048 if ((*this)[0].match(state, move, env))
00049 return progress8;
00050 return -1;
00051 }
00052 };
00053 }
00054 }
00055
00056 #endif
00057
00058
00059
00060