My Project
squareGroup.cc
Go to the documentation of this file.
1/* positionGroup.cc
2 */
4
6RelativeKingXGroup::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
19RelativeKingYGroup::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
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
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:
mutually exclusive set of features
Definition group.h:17
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
@ PTYPE_PIECE_MIN
Definition basic_type.h:104
@ PTYPE_MAX
Definition basic_type.h:105
@ PTYPE_BASIC_MIN
Definition basic_type.h:103