Esempio n. 1
0
        // Obtain the list of station economies from the profile
        public static List <CompanionAppEconomy> EconomiesFromProfile(dynamic json)
        {
            List <CompanionAppEconomy> Economies = new List <CompanionAppEconomy>();

            if (json["lastStarport"] != null && json["lastStarport"]["economies"] != null)
            {
                foreach (dynamic economyJson in json["lastStarport"]["economies"])
                {
                    dynamic             economy = economyJson.Value;
                    CompanionAppEconomy Economy = new CompanionAppEconomy();

                    Economy.name       = (string)economy["name"];
                    Economy.proportion = (decimal)economy["proportion"];
                    Economies.Add(Economy);
                }
            }

            Logging.Debug("Economies are " + JsonConvert.SerializeObject(Economies));
            return(Economies);
        }
Esempio n. 2
0
 public EDDNEconomy(CompanionAppEconomy companionAppEconomy)
 {
     name       = companionAppEconomy.name;
     proportion = companionAppEconomy.proportion;
 }