7 :
Group(name(d, d2)), direction(d), direction2(d2)
9 for (
int attack=0; attack<3; ++attack) {
10 for (
int defense=0; defense<3; ++defense) {
13 push_back(
new Pattern(d, d2, static_cast<Ptype>(s), static_cast<Ptype>(t),
true, attack, defense));
14 push_back(
new Pattern(d, d2, static_cast<Ptype>(s), static_cast<Ptype>(t),
false, attack, defense));
16 push_back(
new Pattern(d, d2, static_cast<Ptype>(s),
PTYPE_EMPTY,
true, attack, defense));
17 push_back(
new Pattern(d, d2, static_cast<Ptype>(s),
PTYPE_EDGE,
true, attack, defense));
22 for (
int x=1; x<=9; ++x) {
23 for (
int y=1; y<=9; ++y) {
58 std::ostringstream ss;
59 ss <<
"Pattern" << direction;
70 std::ostringstream ss;
71 ss <<
"PatLong" << direction_id;
76 :
Group(name(d)), direction_id(d)
79 for (
int s=0; s<((d == 0) ? 5 : 4); ++s) {
80 const Ptype self = self_list[s];
82 for (
int attack=0; attack<3; ++attack) {
83 for (
int defense=0; defense<3; ++defense) {
85 push_back(
new PatternLong(direction,
self,
LongTarget(static_cast<Ptype>(t),
true,
true, attack, defense)));
86 push_back(
new PatternLong(direction,
self,
LongTarget(static_cast<Ptype>(t),
true,
false, attack, defense)));
87 push_back(
new PatternLong(direction,
self,
LongTarget(static_cast<Ptype>(t),
false,
true, attack, defense)));
88 push_back(
new PatternLong(direction,
self,
LongTarget(static_cast<Ptype>(t),
false,
false, attack, defense)));
109 base += unit*2;
break;
111 base += unit*3;
break;
113 if (direction_id != 0)
115 base += unit*4;
break;
119 const Direction direction = makeDirection(
self);
123 if (pp.first.isEdge()) {
127 if (pp.first.isEmpty()) {
132 assert(pp.first.isPiece());
135 index += (pp.first.owner() != move.
player());
143 std::ostringstream ss;
144 ss <<
"PatLong2" << direction_id;
149 :
Group(name(d)), direction_id(d)
152 for (
int s=0; s<((d == 0) ? 5 : 4); ++s) {
153 const Ptype self = self_list[s];
174 base += unit*2;
break;
176 base += unit*3;
break;
178 if (direction_id != 0)
180 base += unit*4;
break;
184 const Direction direction = makeDirection(
self);
205 for (
int attack=0; attack<3; ++attack) {
206 for (
int defense=0; defense<3; ++defense) {
225 if (pp.first.isEdge())
230 if (pp.first.isEmpty()) {
232 index += ! pp.second.canPromote(
alt(state.turn()));
235 assert(pp.first.isPiece());
237 index += (! pp.second.canPromote(pp.first.isPiece() ?
alt(pp.first.owner()) :
alt(move.
player())))*2;
238 index += (pp.first.owner() != move.
player());