Exemplo n.º 1
0
 /**
  * Renvoie la quantité de nourriture disponible sur la case
  * @param Hexa $hexa
  * @return int
  */
 public static function getNourriture(Hexa $hexa)
 {
     if (isset(self::$nourriture[$hexa->getTemperature() . '_' . $hexa->getAltitude() . '_' . $hexa->getVegetation()])) {
         return self::$nourriture[$hexa->getTemperature() . '_' . $hexa->getAltitude() . '_' . $hexa->getVegetation()];
     } else {
         return null;
     }
 }
Exemplo n.º 2
0
 /**
  *
  * Renvoie le type de terrain de l'hexa fourni
  * @param Hexa $hexa
  * @return int
  */
 public static function getType(Hexa $hexa)
 {
     return self::$correspondances[$hexa->getTemperature() . '_' . $hexa->getAltitude() . '_' . $hexa->getVegetation()];
 }