4 #include <core/board.h>
5 #include <core/color.h>
9 State::State(IState
* state
)
10 : Delegators::State(state
) { }
12 IState
* State::clone() const { return new State(m_state
->clone()); }
14 #define COL(i,c) players[c]==White::self() ? i : board()->size().x - i - 1
16 for (int c
= 0; c
< 2; c
++) {
17 const IColor
* color
= players
[c
];
18 int r0
= rank(0, color
);
19 int r1
= rank(1, color
);
21 board()->set(Point(COL(0,c
), r1
), Piece(color
, pawn
));
22 board()->set(Point(COL(0,c
), r0
), Piece(color
, king
));
23 board()->set(Point(COL(1,c
), r0
), Piece(color
, gold
));
24 board()->set(Point(COL(2,c
), r0
), Piece(color
, silver
));
25 board()->set(Point(COL(3,c
), r0
), Piece(color
, bishop
));
26 board()->set(Point(COL(4,c
), r0
), Piece(color
, rook
));
29 setTurn(White::self());
33 } // namespace MiniShogi