Exemplo n.º 1
0
 private function ParsePlanetTypes()
 {
     global $GR_planetTypes;
     foreach ($GR_planetTypes as $planetType => $planetContents) {
         // Database ID
         $id = $planetContents['database_id'];
         // Allowed buildings
         $allowedBuildings = array();
         foreach ($planetContents['allowed_buildings'] as $buildingName) {
             $allowedBuildings[$buildingName] = $this->GetItemByName($buildingName);
         }
         $rg = new ResourceGroup($allowedBuildings);
         // Planet data
         $planetVariations = array();
         foreach ($planetContents['planet_data'] as $planetData) {
             $usedInPosition = $planetData["used_in_position"];
             $planetGroundType = $planetData["planet_type"];
             $planetImages = $planetData["planet_images"];
             $MinTemperatureMin = $planetData["minimal_temperature_min"];
             $MinTemperatureMax = $planetData["minimal_temperature_max"];
             $MaxTemperature = $planetData["maximal_temperature"];
             $planetVariations[] = PlanetData::ForGeneration($usedInPosition, $planetGroundType, $planetType, $planetImages, $MinTemperatureMin, $MinTemperatureMax, $MaxTemperature);
         }
         $this->_planetTypes[$planetType] = new PlanetType($planetType, $id, $rg, $planetVariations);
     }
 }