@@ -189,7 +189,7 @@ |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
192 | - * @param $date_retour |
|
192 | + * @param double $date_retour |
|
193 | 193 | * fonction qui place le trajet en retour |
194 | 194 | */ |
195 | 195 | private function setTrajetRetour($date_retour) { |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | //et compare la liste des batiments qu'il faut pour construire le batiment |
306 | 306 | //a ceux qui sont deja construit dans la base |
307 | 307 | //si tous les batments qu'il faut son batis on autorise la construction du batiment |
308 | - for ($i = 0 ; $i < $c_all_batiment ; $i++) { |
|
308 | + for ($i = 0; $i < $c_all_batiment; $i++) { |
|
309 | 309 | if (!in_array($all_batiment[$i], $batiment_construit)) { |
310 | 310 | $query = $dbc1->select("pour_construire") |
311 | 311 | ->select("temps_construction") |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | else if (count($pour_construire) > 1) { |
348 | 348 | $ok_construction = false; |
349 | 349 | //test si tous les batiments sont construits et on le niveau nécéssaire |
350 | - for ($j = 0 ; $j < count($pour_construire) ; $j++) { |
|
350 | + for ($j = 0; $j < count($pour_construire); $j++) { |
|
351 | 351 | if (in_array($pour_construire[$j][1], $batiment_construit)) { |
352 | 352 | if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { |
353 | 353 | $ok_construction = true; |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | $finx_batiment = $taille_batiment[0]+$posx_batiment; |
435 | 435 | $finy_batiment = $taille_batiment[1]+$posy_batiment; |
436 | 436 | |
437 | - for ($i = $posy ; $i < $finy ; $i++) { |
|
438 | - for ($j = $posx ; $j < $finx ; $j++) { |
|
437 | + for ($i = $posy; $i < $finy; $i++) { |
|
438 | + for ($j = $posx; $j < $finx; $j++) { |
|
439 | 439 | if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) { |
440 | 440 | FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre"); |
441 | 441 | return false; |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | ->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) |
566 | 566 | ->get(); |
567 | 567 | |
568 | - if ((is_array($query)) && (count($query) > 0)){ |
|
568 | + if ((is_array($query)) && (count($query) > 0)) { |
|
569 | 569 | foreach ($query as $obj) { |
570 | 570 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement; |
571 | 571 | } |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | } |
618 | 618 | |
619 | 619 | //si pas assez de ressource |
620 | - if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
620 | + if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
621 | 621 | FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment"); |
622 | 622 | return false; |
623 | 623 | } |
@@ -565,7 +565,7 @@ |
||
565 | 565 | ->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) |
566 | 566 | ->get(); |
567 | 567 | |
568 | - if ((is_array($query)) && (count($query) > 0)){ |
|
568 | + if ((is_array($query)) && (count($query) > 0)) { |
|
569 | 569 | foreach ($query as $obj) { |
570 | 570 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement; |
571 | 571 | } |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | * renvoi le ou les batiments nécéssaires pour la construction du batiment spécifié |
88 | 88 | */ |
89 | 89 | private function getPourConstruire($pour_construire) { |
90 | - for ($i = 0 ; $i < count($pour_construire) ; $i++) { |
|
90 | + for ($i = 0; $i < count($pour_construire); $i++) { |
|
91 | 91 | //si plusieur batiment pour construire le batiment en question |
92 | 92 | $count = count($pour_construire[$i]); |
93 | 93 | if ($count > 1) { |
94 | - for ($j = 0 ; $j < $count ; $j++) { |
|
95 | - $batiment[] = [ |
|
94 | + for ($j = 0; $j < $count; $j++) { |
|
95 | + $batiment[] = [ |
|
96 | 96 | "nom_batiment" => $pour_construire[$i][$j][0], |
97 | 97 | "niveau_batiment" => $pour_construire[$i][$j][2] |
98 | 98 | ]; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | return ["batiments" => $batiment]; |
102 | 102 | } |
103 | 103 | else { |
104 | - $batiment[] = [ |
|
104 | + $batiment[] = [ |
|
105 | 105 | "nom_batiment" => $pour_construire[$i][0][0], |
106 | 106 | "niveau_batiment" => $pour_construire[$i][0][2] |
107 | 107 | ]; |