示例#1
0
        protected override void InterpretRow(Dictionary<string, string> fields)
        {
            int itemId = ParseId(fields["solarSystemID"]);
            string itemName = fields["solarSystemName"];
            float security = ParseNumber(fields["security"]);
            int regionId = ParseId(fields["regionID"]);
            //Console.WriteLine("Line: "+ itemId.ToString() + " " + itemName.ToString() +" " + regionId.ToString());
            Region r = null;

            if (regions.ContainsKey(regionId))
            {
                r = regions[regionId];
            }
            if (r == null)
            {
                r = new Region(regionId);
                regions.Add(regionId, r);
            }

            SolarSystem s = new SolarSystem(itemId, itemName, r, security);
            r.Systems.Add(s);
            solarSystems[itemId] = s;
            solarSystemsByName[itemName] = s;

        }
示例#2
0
 public SolarSystem(int itemId, string itemName, Region region, float security)
 {
     id = itemId;
     name = itemName;
     securityValue = security;
     this.region = region;
     signpostShortest[this] = new SignpostEntry(null, 0);
     if (security >= 0.45f)
     {
         signpostSecure[this] = new SignpostEntry(null, 0);
     }
 }