Ejemplo n.º 1
0
 private function ParseShipUnit($item)
 {
     // Parse ship-specific data
     $enginedetails = $item["weapon_details"]["engine_details"];
     $cargocapacity = $item["weapon_details"]["cargo_capacity"];
     // Parse engine details
     $engineList = array();
     while (list($name, $engine) = each($enginedetails)) {
         $fuelUsage = $engine["fuel_usage"];
         $speed = $engine["speed"];
         $engineList[] = new ShipEngine($name, $fuelUsage, $speed);
     }
     return ShipUnit::FromCombatUnit(self::ParseCombatUnit($item), $engineList, $cargocapacity);
 }
Ejemplo n.º 2
0
 public static function FromList(array $array, Colony $colony, $missionType)
 {
     return new ShipFleet(ShipUnit::MakeListFrom($array), $colony, $missionType);
 }