bigramGroup.cc
Go to the documentation of this file.
00001 /* bigramGroup.cc
00002  */
00003 #include "osl/rating/group/bigramGroup.h"
00004 #include <sstream>
00005 
00006 std::string osl::rating::BigramAttackGroup::name(bool same, bool focus_x)
00007 {
00008   std::ostringstream ss;
00009   ss << "BigramA" << (same ? '=' : '!') << (focus_x ? 'X' : 'Y');
00010   return ss.str();
00011 }
00012 
00013 osl::rating::BigramAttackGroup::BigramAttackGroup(bool s, bool f) 
00014   : Group(name(s, f)), same(s), focus_x(f)
00015 {
00016   for (int x=-2; x<=2; ++x) {
00017     for (int y=-2; y<=2; ++y) {
00018       for (int x2=-2; x2<=2; ++x2) {
00019         for (int y2=-2; y2<=2; ++y2) {
00020           for (int king=0; king<5; ++king) {
00021             push_back(new BigramAttack(x, y, x2, y2, king, same, focus_x));
00022           }
00023         }
00024       }
00025     }
00026   }
00027 }
00028 
00029 int osl::rating::BigramAttackGroup::findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
00030 {
00031   const int index = BigramAttack::index(state, move, env, same, focus_x);
00032   return index;
00033 }
00034 
00035 /* ------------------------------------------------------------------------- */
00036 // ;;; Local Variables:
00037 // ;;; mode:c++
00038 // ;;; c-basic-offset:2
00039 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines