public RoundTripDisplayItem(Map map, RoundTrip data, Parameters parameters) { Text = data.There.TypeName + "/" + data.BackAgain.TypeName; profit = (int)data.Profit; int profitPercentage = (profit * 100) / (int)parameters.Isk; profitPerWarp = (int)data.ProfitPerWarp; SolarSystem startingSystem = map.GetSystem(parameters.StartingSystem); int jumpsFromStart = map.DistanceBetween(startingSystem, data.There.Source.System, true); int jumps = data.There.Jumps(true); string source = data.There.Source.Name; string destination = data.There.Destination.Name; float security = data.Security; string limitedBy = data.There.LimitedBy.ToString(); if (data.BackAgain.ItemType != null) { limitedBy += " / " + data.BackAgain.LimitedBy; } SubItems.Add(profitPerWarp.ToString()); SubItems.Add(profitPercentage + "%"); SubItems.Add(security.ToString()); SubItems.Add(jumpsFromStart.ToString()); SubItems.Add(jumps.ToString()); SubItems.Add(source); SubItems.Add(destination); SubItems.Add(limitedBy.ToString()); }
public RoundTripDisplayItem(Map map, RoundTrip data, Parameters parameters) { Text = data.There.TypeName + "/" + data.BackAgain.TypeName; profit = (int)data.Profit; int profitPercentage = (profit * 100) / (int)parameters.Isk; profitPerWarp = (int)data.ProfitPerWarp; SolarSystem startingSystem = map.GetSystem(parameters.StartingSystem); int jumpsFromStart = map.DistanceBetween(startingSystem, data.There.Source.System, true); int jumps = data.There.Jumps(true); string source = data.There.Source.Name; string destination = data.There.Destination.Name; float security = data.Security; string limitedBy = data.There.LimitedBy.ToString(); if(data.BackAgain.ItemType != null) limitedBy += " / " + data.BackAgain.LimitedBy; SubItems.Add(profitPerWarp.ToString()); SubItems.Add(profitPercentage + "%"); SubItems.Add(security.ToString()); SubItems.Add(jumpsFromStart.ToString()); SubItems.Add(jumps.ToString()); SubItems.Add(source); SubItems.Add(destination); SubItems.Add(limitedBy.ToString()); }
private void AddRoundTrips() { foreach (SingleTrip trade in singleTrips) { SingleTrip there = trade; SingleTrip backAgain = GetBestSingleTrip(there.Destination, there.Source); RoundTrip trip = new RoundTrip(there, backAgain); roundTrips.Add(trip); } roundTrips.Sort(RoundTrip.CompareByProfitPerWarpSecure); }
public static int CompareByProfitPerWarpShortest(RoundTrip a, RoundTrip b) { return b.ProfitPerWarp(false).CompareTo(a.ProfitPerWarp(false)); // highest profit per warp comes first }
public static int CompareByProfit(RoundTrip a, RoundTrip b) { return b.Profit.CompareTo(a.Profit); // highest profit comes first }
public static int CompareByProfitPerWarpSecure(RoundTrip a, RoundTrip b) { return b.ProfitPerWarp(true).CompareTo(a.ProfitPerWarp(true)); // highest profit per warp comes first }
public static int CompareByProfitPerWarpFromStartingSystemShortest(RoundTrip a, RoundTrip b) { return b.ProfitPerWarpFromStartingSystemSecure(false).CompareTo(a.ProfitPerWarpFromStartingSystemSecure(false)); // highest profit per warp comes first }
public static int CompareByProfitPerWarpShortest(RoundTrip a, RoundTrip b) { return(b.ProfitPerWarp(false).CompareTo(a.ProfitPerWarp(false))); // highest profit per warp comes first }
public static int CompareByProfitPerWarpFromStartingSystemShortest(RoundTrip a, RoundTrip b) { return(b.ProfitPerWarpFromStartingSystemSecure(false).CompareTo(a.ProfitPerWarpFromStartingSystemSecure(false))); // highest profit per warp comes first }
public static int CompareByProfit(RoundTrip a, RoundTrip b) { return(b.Profit.CompareTo(a.Profit)); // highest profit comes first }