-
Notifications
You must be signed in to change notification settings - Fork 0
/
interactor.hpp
43 lines (42 loc) · 1.39 KB
/
interactor.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef INTERACTOR_H
#define INTERACTOR_H
#include "board.hpp"
#include "evaluator.hpp"
#include "utility.hpp"
#include "bitmap.hpp"
#include "searcher.hpp"
namespace yrq {
class interactor {
public:
interactor() {};
~interactor() {};
void generate_output(move_action mv) {
std::cout << (int)mv.from.x() << ' ' << (int)mv.from.y() << ' ' << (int)mv.to.x() << ' ' << (int)mv.to.y() << ' ' << (int)mv.arrow.x() << ' ' << (int)mv.arrow.y() << std::endl;
}
std::vector<move_action> parse_input() {
std::vector<move_action> mvs;
int turn, from_x, from_y, to_x, to_y, arrow_x, arrow_y;
bool i_am_black = false;
board bd;
bd.get_arrow_map() = bitmap(0x2400810000810024);
std::cin >> turn;
for (int i = 0; i < turn; ++i) {
std::cin >> from_x >> from_y >> to_x >> to_y >> arrow_x >> arrow_y;
if (from_x == -1);
else {
auto mv = make_move(bd, board::piece(from_x, from_y), board::piece(to_x, to_y), board::piece(arrow_x, arrow_y));
mvs.push_back(mv);
}
if (i < turn - 1) {
std::cin >> from_x >> from_y >> to_x >> to_y >> arrow_x >> arrow_y;
if (from_x >= 0) {
auto mv = make_move(bd, board::piece(from_x, from_y), board::piece(to_x, to_y), board::piece(arrow_x, arrow_y));
mvs.push_back(mv);
}
}
}
return mvs;
}
};
}
#endif