コード例 #1
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());
        }
コード例 #2
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());
        }
コード例 #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);
 }
コード例 #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);
        }
コード例 #5
0
ファイル: Market.cs プロジェクト: spiffydudex/navbot
        /*
        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;
        }
コード例 #6
0
ファイル: SingleTrip.cs プロジェクト: spiffydudex/navbot
        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;
            }
        }
コード例 #7
0
 public SolarSystemJumpsReader(Map map)
 {
     this.map = map;
     ReadFromResource("Data.dbo_mapSolarSystemJumps.csv", "\r\n");
 }
コード例 #8
0
ファイル: TradeFinder.cs プロジェクト: spiffydudex/navbot
 public TradeFinder(Map map, Market market)
 {
     this.map = map;
     this.market = market;
 }
コード例 #9
0
ファイル: TradeFinder.cs プロジェクト: spiffydudex/navbot
 public TradeFinder(Map map, Market market, Parameters parameters)
 {
     this.map = map;
     this.market = market;
     this.Parameters = parameters;
 }
コード例 #10
0
ファイル: StationReader.cs プロジェクト: spiffydudex/navbot
 public StationReader(Map map, string fullPath)
 {
     this.map = map;
     ReadFromFullPath(fullPath);
 }
コード例 #11
0
ファイル: StationReader.cs プロジェクト: spiffydudex/navbot
 public StationReader(Map map)
 {
     this.map = map;
     ReadFromResource("Data.dbo_staStations.csv", "\r\n");
 }