forked from jirfag/PREP-labyrinth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Field.hpp
52 lines (35 loc) · 1002 Bytes
/
Field.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
44
45
46
47
48
49
50
51
52
//
// Created by tsv on 09.05.16.
//
#ifndef LABYRINTH_FIELD_HPP
#define LABYRINTH_FIELD_HPP
#include <vector>
#include <istream>
#include <chrono>
#include "Runner.hpp"
#include "utils.hpp"
using std::vector;
class Field {
private:
struct Position {
size_t x;
size_t y;
};
size_t tic_count = 0;
bool done = false;
vector<vector<BlockType>> field;
Runner runner;
std::chrono::steady_clock::time_point start_time;
Position current_position;
void set_runner_current_status();
std::chrono::microseconds get_time_elapsed_mcs() const;
public:
friend std::istream& operator>>(std::istream& is, Field& field);
bool tic();
bool is_done();
void result(std::ostream& os);
void start();
};
std::istream& operator>>(std::istream& is, Field& field);
std::istream& operator>>(std::istream& is, BlockType& block_type);
#endif //LABYRINTH_FIELD_HPP