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());
        }
        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());
        }
Example #3
0
 protected static TradeFinder Create(string logFilePath)
 {
     if (map == null)
     {
         map = new Map();
     }
     itemDatabase = new ItemDatabase();
     Market market = new Market(itemDatabase, map);
     return Create(map, market, logFilePath, null);
 }
Example #4
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);
        }
Example #5
0
        /*
        private Dictionary<ItemType, StationList> stationsWithItemForSale = new Dictionary<ItemType, StationList>();
        public Dictionary<ItemType, StationList> StationsWithItemForSale
        {
            get { return stationsWithItemForSale; }
        }

        private Dictionary<ItemType, StationList> stationsWithItemWanted = new Dictionary<ItemType, StationList>();
        public Dictionary<ItemType, StationList> StationsWithItemWanted
        {
            get { return stationsWithItemWanted; }
        }

        private Dictionary<Station, ItemList> itemsForSaleAtStation = new Dictionary<Station, ItemList>();
        public Dictionary<Station, ItemList> ItemsForSaleAtStation
        {
            get { return itemsForSaleAtStation; }
        }

        private Dictionary<Station, ItemList> itemsWantedAtStation = new Dictionary<Station, ItemList>();
        public Dictionary<Station, ItemList> ItemsWantedAtStation
        {
            get { return itemsWantedAtStation; }
        }
         * */

        public Market(ItemDatabase itemDatabase, Map map)
        {
            this.itemDatabase = itemDatabase;
            this.map = map;
        }
Example #6
0
        public SingleTrip(Map map, Station source, Station destination)
        {
            this.map = map;
            this.source = source;
            this.destination = destination;

            jumpsSecure = map.DistanceBetween(source.System, destination.System, true);
            jumpsShortest = map.DistanceBetween(source.System, destination.System, false);

            if ((jumpsSecure == jumpsShortest) && (jumpsSecure != int.MaxValue))
            {
                security = SecurityStatus.Level.HighSec;
            }
            else if ((jumpsSecure > jumpsShortest) && (jumpsSecure != int.MaxValue))
            {
                security = SecurityStatus.Level.LowSecShortcut;
            }
            else if ((jumpsSecure == int.MaxValue) && (jumpsShortest != int.MaxValue))
            {
                security = SecurityStatus.Level.LowSecOnly;
            }
            else
            {
                security = SecurityStatus.Level.Isolated;
            }
        }
 public SolarSystemJumpsReader(Map map)
 {
     this.map = map;
     ReadFromResource("Data.dbo_mapSolarSystemJumps.csv", "\r\n");
 }
Example #8
0
 public TradeFinder(Map map, Market market)
 {
     this.map = map;
     this.market = market;
 }
Example #9
0
 public TradeFinder(Map map, Market market, Parameters parameters)
 {
     this.map = map;
     this.market = market;
     this.Parameters = parameters;
 }
Example #10
0
 public StationReader(Map map, string fullPath)
 {
     this.map = map;
     ReadFromFullPath(fullPath);
 }
Example #11
0
 public StationReader(Map map)
 {
     this.map = map;
     ReadFromResource("Data.dbo_staStations.csv", "\r\n");
 }