-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGame.hpp
More file actions
60 lines (48 loc) · 1.05 KB
/
Game.hpp
File metadata and controls
60 lines (48 loc) · 1.05 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
/** Author Stephane LE BOEUF : stephane.leboeuf@digital-lab.fr **/
#pragma once
#include "CImg.h"
#define uchar unsigned char
using namespace cimg_library;
// < NEW COLOR, ANGLE, NEW STATE >
/**
Nota (Angle) :
1 = Forward,
2 = Right,
4 = U-Turn,
8 = Left
**/
class Triplet
{
public:
// Default constructor : create an impossile triplet
Triplet():
colorIndex(-1),
turn(0),
antState(-1) {}
Triplet(int colorIndex, int turn, int antState):
colorIndex(colorIndex),
turn(turn),
antState(antState) {}
int turn;
int colorIndex;
int antState;
};
class Game
{
public:
Game();
Game(const char * filename);
~Game();
Triplet getTriplet(int x, int y);
uchar* getColor(int index);
int getIndex(uchar r, uchar g, uchar b);
int getSize();
private:
void spirale();
int m_stateCard, m_colorCard, m_size ;
Triplet **m_automate;
uchar **m_color;
public:
CImg<uchar> map;
};
/** Author Stephane LE BOEUF : stephane.leboeuf@digital-lab.fr **/