forked from ArthyD/Bestioles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Milieu.h
executable file
·60 lines (38 loc) · 1.26 KB
/
Milieu.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _MILIEU_H_
#define _MILIEU_H_
#include "UImg.h"
#include "Bestiole.h"
#include "BestioleFactory.h"
#include <iostream>
#include <list>
#include <vector>
using namespace std;
class Milieu : public UImg
{
private :
static const T white[];
int width, height;
std::list<std::shared_ptr<Bestiole>> listeBestioles;
double pourcentageKamikaze = 0.15;
double pourcentagePeureuse = 0.25;
double pourcentageGregaire = 0.45;
double pourcentagePrevoyante = 0.15;
double pourcentagePersoMulti = 0.0;
double probaNaissance = 0.0001;
int compteur = 0;
public :
Milieu( int _width, int _height );
~Milieu( void );
int getWidth( void ) const { return width; };
int getHeight( void ) const { return height; };
void step( void );
void phaseAction( void );
void phaseEnvironnement( void );
void phaseDetection( void );
void naissanceAlea( void );
void addPersoAlea( void );
int randomPerso(void);
void readConfig( void );
void addMember(std::shared_ptr<Bestiole> b ) { listeBestioles.push_back(b); listeBestioles.back()->initCoords(width, height); }
};
#endif