forked from mahdisn76/UIAI2017_cpp_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
54 lines (48 loc) · 1.2 KB
/
game.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 GAME_H
#define GAME_H
#include"board.h"
#ifdef _WIN32
/* See http://stackoverflow.com/questions/12765743/getaddrinfo-on-win32 */
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 /* Windows XP. */
#endif
#include <winsock2.h>
#include <Ws2tcpip.h>
#else
/* Assume that any non-Windows platform uses POSIX-style sockets instead. */
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h> /* Needed for getaddrinfo() and freeaddrinfo() */
#include <unistd.h> /* Needed for close() */
#endif
class Game
{
bool dooz;
Board* board;
int myinhandcheckernum;
int oppinhandcheckernum;
string msg_send, msg_recieve;
int server_port;
string server_address;
int sock;
struct sockaddr_in server;
string teamname;
int cycle;
void Game::update_cell_arrays();
public:
Game();
Game(string, int, string);
~Game();
Board& get_board();
bool start_client();
void start();
void play_round(char *);
int get_myinhandcheckernum();
int get_oppinhandcheckernum();
void put(Pos p);
void pop(Checker* c);
void move(Checker* c,Pos newpos);
int get_cycle();
void check_dooz(Pos p);
};
#endif // GAME_H