Ejemplo n.º 1
0
        public EconomicsViewModel()
        {
            Factions = GameState.Instance.Factions;

            if (Factions == null)
            {
                return;
            }

            CurrentFaction = Factions.FirstOrDefault();

            if (Populations != null)
            {
                CurrentPopulation = Populations.FirstOrDefault();
            }
        }
Ejemplo n.º 2
0
 public void AddPopulations(List <Population> populations)
 {
     foreach (Population population in populations)
     {
         Population popMatch = Populations.FirstOrDefault(pop => pop.Race.NamePlural.Equals(population.Race.NamePlural, StringComparison.InvariantCultureIgnoreCase));
         if (popMatch != null)
         {
             popMatch.Count += population.Count;
         }
         else
         {
             Populations.Add(new Population(population.Race, population.Count));
         }
     }
     Populations = Populations.OrderByDescending(pop => pop.Count).ToList();
     Parent?.AddPopulations(populations);
 }
Ejemplo n.º 3
0
 public void AddPopulations(List <Population> populations)
 {
     foreach (Population population in populations)
     {
         Population popMatch = Populations.FirstOrDefault(pop => pop.Race == population.Race);
         if (popMatch != null)
         {
             popMatch.Count += population.Count;
         }
         else
         {
             Populations.Add(new Population(population.Race, population.Count));
         }
     }
     Populations = Populations.OrderByDescending(pop => pop.Count).ToList();
     Parent?.AddPopulations(populations);
 }