-
Notifications
You must be signed in to change notification settings - Fork 2
/
gui.h
54 lines (44 loc) · 943 Bytes
/
gui.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
#ifndef GUI_H
#define GUI_H
#include <string>
#include <vector>
#include <stack>
#include <termios.h>
#include "board.h"
#include "game.h"
namespace checkers {
class Player;
class Game;
class GUI {
public:
GUI();
~GUI();
void clearScreen();
void printBoard(const Board&);
void mark(const Board&, unsigned int);
static void printInt(unsigned int b);
void printLog();
void gameInfo(GameState&);
void moveInfo(SearchResult&);
void println(std::string);
int menu(std::string[], int);
bool dialogbox(std::string);
void messagebox(std::string);
void edit(Board&);
void quit();
void gameOver();
std::string input();
private:
unsigned char getch();
Game* game;
std::string messages[4];
};
// some stuff for the getch function
static struct termios termattr, save_termattr;
static int ttysavefd = -1;
static enum
{
RESET, RAW, CBREAK
} ttystate = RESET;
}
#endif