string ShowBestTrips(ProfitType type) { List <SingleTrip> secureTrips = null; List <SingleTrip> shortestTrips = null; string output = string.Empty; // Testing this at the moment.. int numroutes = Convert.ToInt32(input["numroutes"]); switch (type) { case ProfitType.ProfitPerWarpFromStartingSystem: finder.SortByProfitPerWarpFromStartingSystem(true); secureTrips = finder.BestHighSecTrips(numroutes); finder.SortByProfitPerWarpFromStartingSystem(false); shortestTrips = finder.BestTrips(numroutes); break; case ProfitType.MaxProfitPerWarp: finder.SortByProfitPerWarp(true); secureTrips = finder.BestHighSecTrips(numroutes); finder.SortByProfitPerWarp(false); shortestTrips = finder.BestTrips(numroutes); break; case ProfitType.MaxProfit: finder.SortByProfit(); secureTrips = finder.BestHighSecTrips(numroutes); shortestTrips = finder.BestTrips(numroutes); break; } foreach (SingleTrip trip in secureTrips) { output += "<tr><td>" + Info(trip) + "</td></tr>"; } foreach (SingleTrip trip in shortestTrips) { output += "<tr><td>" + Info(trip) + "</td></tr>"; } return(output); }