public static Economy FromEDName(string from)
 {
     string tidiedFrom = from == null ? null : from.Replace(";", "").ToLowerInvariant();
     Economy result = ECONOMIES.FirstOrDefault(v => v.edname.ToLowerInvariant() == tidiedFrom);
     if (result == null)
     {
         Logging.Report("Unknown Economy ED name " + from);
         result = new Economy(from, tidiedFrom);
     }
     return result;
 }
 public DockedEvent(DateTime timestamp, string system, string station, Superpower allegiance, string faction, State factionstate, Economy economy, Government government, SecurityLevel security) : base(timestamp, NAME)
 {
     this.system = system;
     this.station = station;
     this.allegiance = (allegiance == null ? Superpower.None.name : allegiance.name);
     this.faction = faction;
     this.factionstate = (factionstate == null ? State.None.name : factionstate.name);
     this.economy = (economy == null ? Economy.None.name : economy.name);
     this.government = (government == null ? Government.None.name : government.name);
     this.security = (security == null ? SecurityLevel.Low.name : security.name);
 }
        public static Economy FromName(string from)
        {
            if (from == null)
            {
                return(null);
            }

            Economy result = ECONOMIES.FirstOrDefault(v => v.name == from);

            if (result == null)
            {
                Logging.Report("Unknown Economy name " + from);
            }
            return(result);
        }
 public JumpedEvent(DateTime timestamp, string system, decimal x, decimal y, decimal z, decimal fuelused, decimal fuelremaining, Superpower allegiance, string faction, State factionstate, Economy economy, Government government, SecurityLevel security) : base(timestamp, NAME)
 {
     this.system = system;
     this.x = x;
     this.y = y;
     this.z = z;
     this.fuelused = fuelused;
     this.fuelremaining = fuelremaining;
     this.allegiance = (allegiance == null ? Superpower.None.name : allegiance.name) ;
     this.faction = faction;
     this.factionstate = (factionstate == null ? State.None.name : factionstate.name);
     this.economy = (economy == null ? Economy.None.name : economy.name);
     this.government = (government == null ? Government.None.name : government.name);
     this.security = (security == null ? SecurityLevel.None.name : security.name);
 }
Beispiel #5
0
        public static Economy FromEDName(string from)
        {
            string tidiedFrom = from == null ? null : from.Replace(";", "").ToLowerInvariant();

            Economy result;

            if (tidiedFrom == null || tidiedFrom == "")
            {
                result = null;
            }
            else
            {
                result = ECONOMIES.FirstOrDefault(v => v.edname.ToLowerInvariant() == tidiedFrom);
            }
            if (result == null)
            {
                Logging.Report("Unknown Economy ED name " + from);
                result = new Economy(from, tidiedFrom);
            }
            return(result);
        }
Beispiel #6
0
 public EconomyShare(Economy economy, decimal proportion)
 {
     this.economy    = economy;
     this.proportion = proportion;
 }
Beispiel #7
0
 public EconomyShare(string name, decimal proportion)
 {
     this.economy    = Economy.FromName(name) ?? Economy.FromEDName(name);
     this.proportion = proportion;
 }