1, 1 => 2, 2 => 3, 3 => 0, 4 => 1, 5 => 2, 6 => 3, 7 => 1, 8 => 2, 9 => 3, 10 => 1, 11 => 2, 12 => 3, 13 => 1, 14 => 2, 15 => 3, 16 => 1, 17 => 2, 18 => 3); break; case 1: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3, 18 => 1, 19 => 2, 20 => 3, 21 => 1, 22 => 2, 23 => 3, 24 => 1, 25 => 2, 26 => 3, 27 => 1, 28 => 2, 29 => 3); break; case 2: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 0, 4 => 0, 5 => 1, 6 => 2, 7 => 3); break; case 3: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 0, 7 => 0, 8 => 0, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3); break; case 4: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3); break; case 5: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3, 18 => 1, 19 => 2, 20 => 3, 21 => 1, 22 => 2, 23 => 3, 24 => 1, 25 => 2, 26 => 3); break; case 6: $tableau = array ( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0); break; case 7: $tableau = array ( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 1, 13 => 2, 14 => 3); break; default: trigger_error("Branche ".$branche." introuvable dans les données", E_USER_ERROR); } return $tableau[$id]; } public static function image($object, surface $planete) { $branche = $object[0]; $idTechnologie = $object[1]; if ($planete->race == "covenant") { return Donnees::image_covenant_default; } elseif ($planete->race == "humain") { return Donnees::image_humain_default; } else trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR); } public static function needed($object, surface $planete, $print = false) { switch($object[0]) { case 0: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 0, 4 => 1, 5 => 2, 6 => 3, 7 => 1, 8 => 2, 9 => 3, 10 => 1, 11 => 2, 12 => 3, 13 => 1, 14 => 2, 15 => 3, 16 => 1, 17 => 2, 18 => 3); break; case 1: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3, 18 => 1, 19 => 2, 20 => 3, 21 => 1, 22 => 2, 23 => 3, 24 => 1, 25 => 2, 26 => 3, 27 => 1, 28 => 2, 29 => 3); break; case 2: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 0, 4 => 0, 5 => 1, 6 => 2, 7 => 3); break; case 3: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 0, 7 => 0, 8 => 0, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3); break; case 4: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3); break; case 5: $tableau = array ( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3, 18 => 1, 19 => 2, 20 => 3, 21 => 1, 22 => 2, 23 => 3, 24 => 1, 25 => 2, 26 => 3); break; case 6: $tableau = array ( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0); break; case 7: $tableau = array ( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 1, 13 => 2, 14 => 3); break; default: trigger_error("Branche ".$branche." introuvable dans les données", E_USER_ERROR); } if ($print) return dDonnees::print_neededCheck($tableau[$object[1]], $planete); else return dDonnees::neededCheck($tableau[$object[1]], $planete); } /* Fonction qui transpforme l'id d'une technologie en son équivalent en bit dans la liste */ public static function idToBit($id) { return pow(2, $id); } public static function bitToId($bit) { return log($bit, 2); } } ?>