-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboard.h
More file actions
77 lines (57 loc) · 1.47 KB
/
board.h
File metadata and controls
77 lines (57 loc) · 1.47 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// Created by Hash on 4/14/2016.
//
#ifndef ROSETTE_BOARD_H
#define ROSETTE_BOARD_H
#include <allegro5/allegro_primitives.h>
#include "global.h"
#include "Util/hex.h"
#include "view.h"
#include "hud.h"
#define BOARD_OFFSET 7
#define HEX_COUNT 140
typedef enum {
P_WHITE,
P_BLACK
} PionType;
typedef struct{
int degre_liberte;
int type;
} Pion;
typedef struct {
Hex hex_position;
Point pixel_position;
int used;
int white_count;
int black_count;
} Hexagonal;
typedef struct Intersection {
Vertex hex_position; //coordonnee dans le systeme hexagonal
Point pixel_position; // position sur l'ecran
Pion *pion;
struct Intersection *parent; //Lui-meme s'il est place avant tout autre
int used;
int hovered;
int visited;
int libre;
struct Intersection *voisin[3];
} Intersection;
typedef struct {
Hexagonal hexagonals[13][13];
Intersection intersections[15][15][2];
} Board;
extern Board board;
int pion_suivant();
void creer_hexagone(int q, int r, int s);
void init_board();
void deinit_board();
void afficher_board();
void afficher_hexagone(Hex *hex);
int maj_board();
Hexagonal *trouver_hexagone(int q, int r, int s);
Intersection *trouver_intersection(Vertex vert);
void trouver_intersections_voisins(Intersection *inter);
void check_group(Intersection *inter, Intersection *last_inter_play);
int init_intersections(const Vertex *verts);
int check_from(Intersection *inter);
#endif //ROSETTE_BOARD_H