-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAttraction.php
47 lines (39 loc) · 1.08 KB
/
Attraction.php
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
<?php
require_once "Parc.php";
class Attraction
{
public string $nom;
public int $ptMaintenance;
public int $ptProprete;
function __construct(string $nom = " ")
{
$this->nom = $nom;
$this->ptMaintenance = 100;
$this->ptProprete = 100;
}
// Affiche les infos de l'attraction (propreté et maintenante) :
public function info()
{
return "Maintenance : " . $this->ptMaintenance . " | Propreté : " . $this->ptProprete . PHP_EOL;
}
// Ajoute des points de maintenance :
public function reparation()
{
return $this->ptMaintenance += 5;
}
// Ajoute des points de propreté
public function nettoyage()
{
return $this->ptProprete += 5;
}
// Enlève des points de maintenance :
public function degradation()
{
return $this->ptMaintenance -= 5;
}
// Enlève des points de propreté (devrait combiner la fonction vomi() de SensationsFortes) :
public function salete()
{
$this->ptProprete -= 5;
}
}