@@ -320,13 +320,13 @@ discard block |
||
320 | 320 | $batiment_construit = $this->getBatimentBase(); |
321 | 321 | |
322 | 322 | //recuperation de la liste complete des batiments |
323 | - $c_all_batiment = $this->getAllBatimentGame(); |
|
323 | + $c_all_batiment = $this->getAllBatimentGame(); |
|
324 | 324 | |
325 | 325 | //boucle qui recupere en tableau le champ pour_construire d'un batiment |
326 | 326 | //et compare la liste des batiments qu'il faut pour construire le batiment |
327 | 327 | //a ceux qui sont deja construit dans la base |
328 | 328 | //si tous les batments qu'il faut son batis on autorise la construction du batiment |
329 | - for ($i = 0 ; $i < $c_all_batiment ; $i++) { |
|
329 | + for ($i = 0; $i < $c_all_batiment; $i++) { |
|
330 | 330 | if (!in_array($this->all_batiment[$i], $batiment_construit)) { |
331 | 331 | $query = $dbc1->select("pour_construire") |
332 | 332 | ->select("temps_construction") |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | $ok_construction = false; |
368 | 368 | //test si tous les batiments sont construits et on le niveau nécéssaire |
369 | 369 | $count = count($pour_construire); |
370 | - for ($j = 0 ; $j < $count ; $j++) { |
|
370 | + for ($j = 0; $j < $count; $j++) { |
|
371 | 371 | if (in_array($pour_construire[$j][1], $batiment_construit)) { |
372 | 372 | if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { |
373 | 373 | $ok_construction = true; |
@@ -452,8 +452,8 @@ discard block |
||
452 | 452 | $finx_batiment = $taille_batiment[0]+$posx_batiment; |
453 | 453 | $finy_batiment = $taille_batiment[1]+$posy_batiment; |
454 | 454 | |
455 | - for ($i = $posy ; $i < $finy ; $i++) { |
|
456 | - for ($j = $posx ; $j < $finx ; $j++) { |
|
455 | + for ($i = $posy; $i < $finy; $i++) { |
|
456 | + for ($j = $posx; $j < $finx; $j++) { |
|
457 | 457 | if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) { |
458 | 458 | FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre"); |
459 | 459 | return false; |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | ->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) |
584 | 584 | ->get(); |
585 | 585 | |
586 | - if ((is_array($query)) && (count($query) > 0)){ |
|
586 | + if ((is_array($query)) && (count($query) > 0)) { |
|
587 | 587 | foreach ($query as $obj) { |
588 | 588 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement; |
589 | 589 | } |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $ressource = $this->getRessourceConstruireBatiment($this->nom_batiment_sql, $this->niveau_batiment); |
636 | 636 | |
637 | 637 | //si pas assez de ressource |
638 | - if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
638 | + if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
639 | 639 | FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment"); |
640 | 640 | return false; |
641 | 641 | } |