-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresource.h
More file actions
62 lines (49 loc) · 1.95 KB
/
resource.h
File metadata and controls
62 lines (49 loc) · 1.95 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
#ifndef RESSOURCE_H
#define RESSOURCE_H
#define NB_RESSOURSES 4
#define CATCHING_TIME 5
#include <Qt>
#include "MersenneTwister.h"
#include "structure.h"
enum resource_dispo {
Diamond,///< Ressou rare très convoitée du commerçant.
Gold, ///< Ressource rare vendu très chere.
Silver, ///< Ressource limité, peut être vendu à bon prix.
Bronze ///< Ressource abondante, vendu à bas prix.
};
class Clan;
class Resource
{
private :
unsigned _id;
unsigned _type;
static Qt::GlobalColor color[];
Position _position;
Clan *_clan;
unsigned _ressourcesProduite; ///< Nombre de ressources produites depuis l'acquisition de la ressources.
unsigned _currentCatching;
static int _NbResource;
static Position _compare;
public:
Resource(unsigned type, unsigned x, unsigned y,Clan *clan = NULL);
unsigned getType() {return _type;}
Qt::GlobalColor getColor() {return color[_type];}
Position getPosition() const {return _position;}
Clan* getClan() {return _clan;}
unsigned getRessourcesProduite() {return _ressourcesProduite;}
void RAZRessourcesProduite() {_ressourcesProduite = 0;}
void setClan(Clan *clan) {_clan = clan; _ressourcesProduite = 0;}
unsigned cathing(){ return ++_currentCatching; }
void setCurrentCatching(unsigned inC) { _currentCatching=inC;}
void incRessourcesProduite() {++_ressourcesProduite;}
static int GetNbResource() {return _NbResource;}
static void InitNbResource() {_NbResource = 0;}
friend bool operator==(const Resource ressource1, const Resource ressource2);
/// 2 booléens utilisés lors de la phase d'exploration
bool _viseJedi;
bool _viseSith;
static void setCompare(Position centre) {_compare = centre;}
static Position getCompare() {return _compare;}
static const unsigned probaRes[];
};
#endif // RESSOURCE_H