Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        public SingleTripDisplayItem(Map map, SingleTrip data, Parameters parameters)
        {
            Text = data.TypeName;
            profit = (int)data.Profit;
            int profitPercentage = (profit * 100) / (int)parameters.Isk;

            SolarSystem startingSystem = map.GetSystem(parameters.StartingSystem);
            if (startingSystem == null)
                profitPerWarp = (int)data.ProfitPerWarp(true);
            else
            {
                data.StartingSystem = startingSystem;
                profitPerWarp = (int)data.ProfitPerWarpFromStartingSystem(true);
            }

            int jumpsFromStart = map.DistanceBetween(startingSystem, data.Source.System, true);
            int jumps = data.Jumps(true);
            string source = data.Source.Name;
            string destination = data.Destination.Name;
            SecurityStatus.Level security = data.Security;
            LimitingFactor limitedBy = data.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());
        }
Exemplo n.º 3
0
        public static TradeFinder Create(Map map, Market market, string logFilePath, Parameters parameters)
        {
            ArchiveOutOfDateLogs(logFilePath);

            string[] logs = ReportList(logFilePath);

            if (logs.Length == 0)
                return null;

            map.ClearMarketData();

            foreach (string s in logs)
            {
                market.ReadFromFullPath(s);
            }

            return new TradeFinder(map, market, parameters);
        }
Exemplo n.º 4
0
 public TradeFinder(Map map, Market market, Parameters parameters)
 {
     this.map = map;
     this.market = market;
     this.Parameters = parameters;
 }