-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame6561.h
59 lines (47 loc) · 1.39 KB
/
Game6561.h
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
53
54
55
56
57
58
59
#ifndef CODECUP_GAME6561_H
#define CODECUP_GAME6561_H
#include <istream>
#include <ostream>
#include "Board.h"
#include "Algorithm.h"
#include "Move.h"
#include <utility>
#include <string>
#include "GameRhythmState.h"
#include "GameProgress.h"
class Game6561 {
public:
static const std::size_t MAX_MOVES = 1000;
Game6561(std::istream& istream, std::ostream& ostream, std::ostream& logStream, Algorithm& algorithm);
void run();
private:
std::istream& istream;
std::ostream& ostream;
std::ostream& logStream;
Board board;
Algorithm& algorithm;
GameProgress gameProgress;
std::string nextLine;
/**
* Reads one line from input and stores it into global var 'nextLine'
* @return false if nextLine equals 'Quit', true otherwise
*/
bool readNextLine();
/**
* parses the content of the 'nextLine' var and updates the board accordingly
*/
void parseNextLine();
void readPiece(PieceColor color);
void readSlide();
const Coords readCoords();
/**
* calculate the next move, updates the board and tells output that move.
* If no valid move is available or the 1000 moves have been reached, this does nothing.
*/
void doMove();
void writeCoords(const Coords& coords);
void writeSlide(const SlideDirection& slideDirection);
// debug functions
void printBoard();
};
#endif //CODECUP_GAME6561_H