My Project
std
osl
rating
group
squareGroup.cc
Go to the documentation of this file.
1
/* positionGroup.cc
2
*/
3
#include "
osl/rating/group/squareGroup.h
"
4
5
osl::rating::
6
RelativeKingXGroup::RelativeKingXGroup
(
bool
a) :
Group
(a ?
"KingRelAX"
:
"KingRelDX"
), attack(a)
7
{
8
for
(
int
x=0; x<9; ++x) {
9
for
(
int
old_x=0; old_x<10; ++old_x) {
10
for
(
int
s=
PTYPE_PIECE_MIN
; s<=
PTYPE_MAX
; ++s) {
11
for
(
int
p=0; p<8; ++p)
// progress8
12
push_back(
new
RelativeKingX
(x, old_x, a,
static_cast<
Ptype
>
(s)));
13
}
14
}
15
}
16
}
17
18
osl::rating::
19
RelativeKingYGroup::RelativeKingYGroup
(
bool
a) :
Group
(a ?
"KingRelAY"
:
"KingRelDY"
), attack(a)
20
{
21
for
(
int
y=-8; y<9; ++y) {
22
for
(
int
old_y=-8; old_y<10; ++old_y) {
23
for
(
int
s=
PTYPE_PIECE_MIN
; s<=
PTYPE_MAX
; ++s) {
24
for
(
int
p=0; p<8; ++p)
// progress8
25
push_back(
new
RelativeKingY
(y, old_y, a,
static_cast<
Ptype
>
(s)));
26
}
27
}
28
}
29
}
30
31
osl::rating::SquareXGroup::SquareXGroup
() :
Group
(
"SquareX"
)
32
{
33
for
(
int
x=1; x<=5; ++x) {
34
for
(
int
s=
PTYPE_PIECE_MIN
; s<=
PTYPE_BASIC_MIN
; ++s) {
// we cannot drop KING
35
for
(
int
p=0; p<8; ++p)
// progress8
36
push_back(
new
SquareX
(x,
static_cast<
Ptype
>
(s),
false
));
37
}
38
for
(
int
s=
PTYPE_BASIC_MIN
+1; s<=
PTYPE_MAX
; ++s) {
39
for
(
int
p=0; p<8; ++p)
// progress8
40
push_back(
new
SquareX
(x,
static_cast<
Ptype
>
(s),
false
));
41
for
(
int
p=0; p<8; ++p)
// progress8
42
push_back(
new
SquareX
(x,
static_cast<
Ptype
>
(s),
true
));
43
}
44
}
45
}
46
47
osl::rating::SquareYGroup::SquareYGroup
() :
Group
(
"SquareY"
)
48
{
49
for
(
int
y=1; y<=9; ++y) {
50
for
(
int
s=
PTYPE_PIECE_MIN
; s<=
PTYPE_BASIC_MIN
; ++s) {
// we cannot drop KING
51
for
(
int
p=0; p<8; ++p)
// progress8
52
push_back(
new
SquareY
(y,
static_cast<
Ptype
>
(s),
false
));
53
}
54
for
(
int
s=
PTYPE_BASIC_MIN
+1; s<=
PTYPE_MAX
; ++s) {
55
for
(
int
p=0; p<8; ++p)
// progress8
56
push_back(
new
SquareY
(y,
static_cast<
Ptype
>
(s),
false
));
57
for
(
int
p=0; p<8; ++p)
// progress8
58
push_back(
new
SquareY
(y,
static_cast<
Ptype
>
(s),
true
));
59
}
60
}
61
}
62
63
/* ------------------------------------------------------------------------- */
64
// ;;; Local Variables:
65
// ;;; mode:c++
66
// ;;; c-basic-offset:2
67
// ;;; End:
osl::rating::Group
mutually exclusive set of features
Definition
group.h:17
osl::rating::RelativeKingX
Definition
square.h:44
osl::rating::RelativeKingY
Definition
square.h:81
osl::rating::SquareX
Definition
square.h:125
osl::rating::SquareY
Definition
square.h:147
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition
basic_type.h:84
osl::PTYPE_PIECE_MIN
@ PTYPE_PIECE_MIN
Definition
basic_type.h:104
osl::PTYPE_MAX
@ PTYPE_MAX
Definition
basic_type.h:105
osl::PTYPE_BASIC_MIN
@ PTYPE_BASIC_MIN
Definition
basic_type.h:103
squareGroup.h
osl::rating::RelativeKingXGroup::RelativeKingXGroup
RelativeKingXGroup(bool a)
Definition
squareGroup.cc:6
osl::rating::RelativeKingYGroup::RelativeKingYGroup
RelativeKingYGroup(bool a)
Definition
squareGroup.cc:19
osl::rating::SquareXGroup::SquareXGroup
SquareXGroup()
Definition
squareGroup.cc:31
osl::rating::SquareYGroup::SquareYGroup
SquareYGroup()
Definition
squareGroup.cc:47
Generated by
1.9.8