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); }
public static function FromList(array $array, Colony $colony, $missionType) { return new ShipFleet(ShipUnit::MakeListFrom($array), $colony, $missionType); }