public EdSystem parseSystem()
        {
            var system = new EdSystem();

            var startOfSystemName = line.IndexOf("(", StringComparison.Ordinal);
            var endOfSystemName = line.IndexOf(")", startOfSystemName, StringComparison.Ordinal);
            system.Id = int.Parse(line.Substring(7, startOfSystemName - 7));
            system.Name = line.Substring(startOfSystemName+1, endOfSystemName - startOfSystemName - 1);
            //system.Stations Should be filled from database

            return system;
        }
Example #2
0
        public EdSystem Test()
        {
            var system = new EdSystem {Name = "LS 3482", Id = 1};

            var stationA = new EdStation {Id = 1, Name = "Eudoxus Dock"};

            var cBeer = new EdCommodity
            {
                Id = 1,
                Name = "Beer",
                Sell = 176,
                Buy = 0,
                Demand = 9755,
                DemandRate = DemandSupplyRate.High,
                Supply = 0,
                SupplyRate = DemandSupplyRate.None
            };

            var cCrop = new EdCommodity
            {
                Id = 2,
                Name = "Crop Harvesters",
                Sell = 1997,
                Buy = 2023,
                Demand = 0,
                DemandRate = DemandSupplyRate.None,
                Supply = 10655,
                SupplyRate = DemandSupplyRate.Medium
            };

            stationA.Commodities.Add(cBeer);
            stationA.Commodities.Add(cCrop);

            system.Stations.Add(stationA);

            return system;

        }
 public EdLogLineSystemArgs(EdSystem system)
 {
     this.System = system;
 }