Adefinir  Finale
SoundDesigner.php
Go to the documentation of this file.
1 <?php
2 namespace App\Models\Metiers;
3 
4 use app\Models\Employes;
5 
6 /* SoundDesigner
7  Classe représentant un employé travaillant en tant que Sound Designer
8 */
9 class SoundDesigner {
10 
11  // Nombre d'employés actuellement embauchés
12  private int $_nbEmployees = 0;
13 
14  // ====================================================================
15 
16  //Construct
17  public function _construct() {
18  $this->_nbEmployee = 0;
19  }
20 
28  public function workOnSoundScape( Employes $employees ) {
29  $employees->incrementActionResults( "soundScape", $this->_nbEmployees );
30  }
31 
39  public function buyLicense( Employes $employees ) {
40  $employees->incrementActionresults( "soundScape", $this->_nbEmployees );
41  }
42 
43 
51  public function hireSoundDesigner() : int {
52 
53  //On ajoute un employé de cette classe de métier
54  $this->_nbEmployees += 1;
55  return $this->_nbEmployees;
56  }
57 
65  public function fireSoundDesigner() : int {
66 
67  //On vérifie si le joueur à au moins un employé de cette classe de métier
68  if ($this->_nbEmployees != 0){
69 
70  //Si oui , on enlève un employé de cette classe de métier au total
71  $this->_nbEmployees = $this->_nbEmployees - 1;
72  }
73  return $this->_nbEmployees;
74  }
75 }
App\Models\Employes
Definition: Employes.php:24
App\Models\Metiers\SoundDesigner\fireSoundDesigner
fireSoundDesigner()
Definition: SoundDesigner.php:65
App\Models\Metiers\SoundDesigner\workOnSoundScape
workOnSoundScape(Employes $employees)
Definition: SoundDesigner.php:28
App\Models\Metiers\SoundDesigner\_construct
_construct()
Definition: SoundDesigner.php:17
App\Models\Metiers\SoundDesigner\hireSoundDesigner
hireSoundDesigner()
Definition: SoundDesigner.php:51
App\Models\Employes\incrementActionResults
incrementActionResults(string $varName, int $increment)
Definition: Employes.php:202
App\Models\Metiers
Definition: Developpeur.php:2
App\Models\Metiers\SoundDesigner\buyLicense
buyLicense(Employes $employees)
Definition: SoundDesigner.php:39
App\Models\Metiers\SoundDesigner
Definition: SoundDesigner.php:9