-
Notifications
You must be signed in to change notification settings - Fork 44
/
OXTypes.h
41 lines (32 loc) · 895 Bytes
/
OXTypes.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
/*
* OXTypes.h
* Michal Czardybon
*
* Wpolne typy danych
*
*/
#ifndef _OXTYPES
#define _OXTYPES
// maksymalny rozmiar planszy
const int MAX_BOARD_WIDTH = 64;
const int MAX_BOARD_HEIGHT = 32;
// maksymalna liczba pol / ruchow
const int MAX_CELLS = MAX_BOARD_WIDTH * MAX_BOARD_HEIGHT;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned long ULONG;
// wektory dla 4 kierunkow
const int DX[4] = {1, 0, 1, 1};
const int DY[4] = {0, 1, 1, -1};
// wspolrzedne na planszy
struct OXPoint
{
OXPoint(int _x = 0, int _y = 0) : x(_x), y(_y) {}
bool operator == (const OXPoint &p) {return x == p.x && y == p.y;}
unsigned char x, y;
};
// zawartosc pola na planszy
enum OXPiece {EMPTY = 2, OP = 0, XP = 1, WRONG = 3};
// makro zwracajace symbol przeciwnika
#define OPPONENT(x) ((x) == OP ? XP : OP)
#endif