Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
lib
rating
group
bigramGroup.cc
Go to the documentation of this file.
1
/* bigramGroup.cc
2
*/
3
#include "
osl/rating/group/bigramGroup.h
"
4
#include <sstream>
5
6
std::string
osl::rating::BigramAttackGroup::name
(
bool
same,
bool
focus_x)
7
{
8
std::ostringstream ss;
9
ss <<
"BigramA"
<< (same ?
'='
:
'!'
) << (focus_x ?
'X'
:
'Y'
);
10
return
ss.str();
11
}
12
13
osl::rating::BigramAttackGroup::BigramAttackGroup
(
bool
s,
bool
f)
14
:
Group
(name(s, f)), same(s), focus_x(f)
15
{
16
for
(
int
x=-2; x<=2; ++x) {
17
for
(
int
y=-2; y<=2; ++y) {
18
for
(
int
x2=-2; x2<=2; ++x2) {
19
for
(
int
y2=-2; y2<=2; ++y2) {
20
for
(
int
king=0; king<5; ++king) {
21
push_back(
new
BigramAttack
(x, y, x2, y2, king,
same
,
focus_x
));
22
}
23
}
24
}
25
}
26
}
27
}
28
29
int
osl::rating::BigramAttackGroup::findMatch
(
const
NumEffectState& state,
Move
move,
const
RatingEnv
& env)
const
30
{
31
const
int
index =
BigramAttack::index
(state, move, env, same, focus_x);
32
return
index;
33
}
34
35
/* ------------------------------------------------------------------------- */
36
// ;;; Local Variables:
37
// ;;; mode:c++
38
// ;;; c-basic-offset:2
39
// ;;; End:
Generated on Sun Jul 21 2013 13:37:23 by
1.8.4