-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplanet.h
More file actions
61 lines (50 loc) · 1.56 KB
/
Copy pathplanet.h
File metadata and controls
61 lines (50 loc) · 1.56 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
#ifndef PLANETE_H
#define PLANETE_H
#include "commercial.h"
#include <QThread>
#define HAUTEUR 50
#define LARGEUR 50
#define PROBA_RESSOURCE 2 /// En %
#define PROBA_NAISS 1 /// En %age du nombre total de ClanMember
#define NB_PATHFINDER_START 15
#define PROBA_NAISS_MERGE 33 // En %
class Clan;
class Pathfinder;
class ClanMember;
class Planet : public QThread
{
Q_OBJECT
private :
// Matrice contenant les agents et ressources de la map
Agents ***_map;
Clan *_clan[2];
bool ** _fightingMap;
bool _running;
unsigned _time;
bool _run;
// Initialisation de la map
void init_ressource();
/// Position de départ des deux clans
static Position posDepartClan[2];
protected :
void run();
public:
explicit Planet(QObject *parent = 0);
~Planet();
Agents*** getMap() {return _map;}
Clan* getClan(unsigned clan) {return _clan[clan];}
Clan** getClans() {return _clan;}
bool ***getMapClan();
bool ** getFightingMap() { return _fightingMap; }
void naissance();
unsigned* getT() {return &_time;}
void stop() {_running = false;}
bool allResourceBusy();
ClanMember* getMember(Position xy, unsigned clan);
Resource* plusProcheRessourceClan(Position inPos,unsigned inClan);
void changedRun() {_run = !_run;}
Position getCentreColonie(int alliance);
signals :
void modelChanged();
};
#endif // PLANETE_H