Adefinir  Finale
Psychologue.php
Go to the documentation of this file.
1 <?php
7 namespace App\Models\Metiers;
8 
10 
11 class Psychologue {
12 
13  // Contient le nombre d'employés actuellements embauchés
14  private int $_nbEmployees = 0;
15 
16  // ====================================================================
17 
18  // Constructeur
19  public function _construct() {
20  $this->_nbEmployees = 0;
21  }
22 
23 
31  public function workOnFocus( Employes $employees ) {
32  $employees->incrementActionResults( "focus", $this->_nbEmployees );
33  }
34 
35 
43  public function workOnAffordance(Employes $employees) {
44  $employees->incrementActionResults( "affordance", $this->_nbEmployees );
45  }
46 
47 
55  public function hirePsychologue() : int {
56 
57  //On ajoute un employé de cette classe de métier
58  $this->_nbEmployees += 1;
59  return $this->_nbEmployees;
60  }
61 
69  public function firePsychologue() : int {
70 
71  //On vérifie si le joueur à au moins un employé de cette classe de métier
72  if ($this->_nbEmployees != 0){
73 
74  //Si oui , on enlève un employé de cette classe de métier au total
75  $this->_nbEmployees = $this->_nbEmployees - 1;
76  }
77  return $this->_nbEmployees;
78  }
79 }
App\Models\Employes
Definition: Employes.php:24
App\Models\Metiers\Psychologue\workOnAffordance
workOnAffordance(Employes $employees)
Definition: Psychologue.php:43
App\Models\Employes\incrementActionResults
incrementActionResults(string $varName, int $increment)
Definition: Employes.php:202
App\Models\Metiers\Psychologue\_construct
_construct()
Definition: Psychologue.php:19
App\Models\Metiers\Psychologue\workOnFocus
workOnFocus(Employes $employees)
Definition: Psychologue.php:31
App\Models\Metiers
Definition: Developpeur.php:2
App\Models\Metiers\Psychologue\hirePsychologue
hirePsychologue()
Definition: Psychologue.php:55
App\Models\Metiers\Psychologue\firePsychologue
firePsychologue()
Definition: Psychologue.php:69
App\Models\Metiers\Psychologue
Definition: Psychologue.php:11