Affiche le nombre de case qu'a la planète + rend une ligne de la Class Planete plus lisible

This commit is contained in:
Nigel Sheldon 2021-02-28 12:10:53 +01:00
parent aff1550919
commit f69d4bf376
2 changed files with 23 additions and 3 deletions

View File

@ -671,7 +671,27 @@ class Planete extends Surface
$prod_hy -= $conso_h; $prod_hy -= $conso_h;
if ($retarray) { if ($retarray) {
return array(array(ceil($this->coeff_bat[0]*100), ceil($this->coeff_bat[1]*100), ceil($this->coeff_bat[2]*100), ceil($this->coeff_bat[3]*100), ceil($this->coeff_bat[4]*100)), array($prod_met, $prod_cri, $prod_hy + $conso_h, $energie_s*$this->coeff_bat[3], $energie_f*$this->coeff_bat[4]), array($energie_m*$this->coeff_bat[0], $energie_c*$this->coeff_bat[1], $energie_h*$this->coeff_bat[2], $conso_h, ($energie_s*$this->coeff_bat[3] + $energie_f*$this->coeff_bat[4])-($energie_m*$this->coeff_bat[0] + $energie_c*$this->coeff_bat[1] + $energie_h*$this->coeff_bat[2]))); return array(
array(
ceil($this->coeff_bat[0]*100),
ceil($this->coeff_bat[1]*100),
ceil($this->coeff_bat[2]*100),
ceil($this->coeff_bat[3]*100),
ceil($this->coeff_bat[4]*100)),
array(
$prod_met,
$prod_cri,
$prod_hy + $conso_h,
$energie_s*$this->coeff_bat[3],
$energie_f*$this->coeff_bat[4]),
array(
$energie_m*$this->coeff_bat[0],
$energie_c*$this->coeff_bat[1],
$energie_h*$this->coeff_bat[2],
$conso_h,
($energie_s*$this->coeff_bat[3] + $energie_f*$this->coeff_bat[4])-($energie_m*$this->coeff_bat[0] + $energie_c*$this->coeff_bat[1] + $energie_h*$this->coeff_bat[2])
)
);
} else { } else {
return array($prod_met, $prod_cri, $prod_hy); return array($prod_met, $prod_cri, $prod_hy);
} }

View File

@ -27,7 +27,7 @@
<h2>Infos</h2> <h2>Infos</h2>
{if $smarty.const.SURFACE == "planete"} {if $smarty.const.SURFACE == "planete"}
<h4>{php}dDonnees::nameVilles($this->_tpl_vars['planete']->batiments[17]){/php}</h4> <h4>{php}dDonnees::nameVilles($this->_tpl_vars['planete']->batiments[17]){/php}</h4>
<h4>Diamètre: {$diametre|separerNombres} km <ins>({$planete->casesRest} case{if $planete->casesRest > 1}s{/if} disponible{if $planete->casesRest > 1}s{/if} sur {php}dDonnees::capaciteVilles($this->_tpl_vars['planete']){/php})</ins></h4> <h4>Diamètre: {$diametre|separerNombres} km <ins>({$planete->casesRest} case{if $planete->casesRest > 1}s{/if} disponible{if $planete->casesRest > 1}s{/if} sur {$planete->cases})</ins></h4>
{/if} {/if}
<h4>Race : {$planete->race}</h4> <h4>Race : {$planete->race}</h4>
<h4>position: <a href="?p=carte&amp;galaxie={$planete->galaxie}&amp;ss={$planete->ss}">{$planete->galaxie}.{$planete->ss}.{$planete->position}</a></h4> <h4>position: <a href="?p=carte&amp;galaxie={$planete->galaxie}&amp;ss={$planete->ss}">{$planete->galaxie}.{$planete->ss}.{$planete->position}</a></h4>