-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodesnippet.txt
69 lines (55 loc) · 2.21 KB
/
codesnippet.txt
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
----------------------------------------------------------------------------------------------
class Healthy:public HealthState{ //a completar
public:
bool isHealthy() { return true; }
bool getInfected(bool infectious,Human * h) {return false;h->Become_Infected();} //volver a escribir cuando esten las reglas y etc
};
----------------------------------------------------------------------------------------------
class Infected:public HealthState{ //a completar
int days_infected = 0;
SimulationParameters sim_pars;
public:
bool isInfected() { return true; }
bool isInfectious() {return true;}
void passDay(Human * h) {
days_infected++;
if(days_infected == sim_pars.getUntilSickDays()){
h->Become_Sick();
}
};
}; //completar con definicion
---------------------------------------------------------------------------------------------
class Sick:public HealthState{ //a completar
int days_sick = 0;
SimulationParameters sim_pars;
public:
bool isSick(){return true;}
bool isInfectious(){return true;}
bool isVisiblyInfectious() {return true;}
void passDay(Human * h){
days_sick++;
//completar aca
}
}; //completar con definicion
---------------------------------------------------------------------------------------------
class Immune:public HealthState{ //esta listo
int days_immune = 0;
SimulationParameters sim_pars;
public:
bool isImmune() { return true; }
bool isInfectious() {return true;}
void passDay(Human * h) {
days_immune++;
if(days_immune == sim_pars.getUntilHealthyDays()){
h->Become_Healthy();
}
}
}; //completar con definicion
----------------------------------------------------------------------------------------------
class Dead:public HealthState{ //creo que esta completo
public:
bool isDead(){return true;}
bool isInfectious(){return true;}
bool isVisiblyInfectious(){return true;}
}; //completar con definicion
----------------------------------------------------------------------------------------------