Ejemplo n.º 1
0
 public Settlement(string name, Location.Location location, Culture.Culture culture)
 {
     Name          = name;
     Location      = location;
     TechManager   = new TechManager(culture.TechTree);
     Culture       = culture;
     Stockpile     = new Stockpile();
     TodaysWeather = Location.GenerateWeather();
 }
Ejemplo n.º 2
0
        public Dynasty GetDynastyByCulture(Dictionary <int, Dynasty> availDynasties, Culture.Culture cul, Random rand)
        {
            List <Dynasty> dynList = GetDynastyListByCulture(availDynasties, cul);

            Dynasty dyn = dynList.RandomItem(rand);

            if (dyn == null)
            {
                //Find one in the same culture group
                List <Culture.Culture> culList = cul.Group.Cultures.Select(c => c.Value).ToList();
                culList.Remove(cul);
                while (dyn == null && culList.Count > 0)
                {
                    cul = culList.RandomItem(rand);
                    culList.Remove(cul);

                    dynList = GetDynastyListByCulture(availDynasties, cul);

                    dyn = dynList.RandomItem(rand);
                }
            }
            return(dyn);
        }
Ejemplo n.º 3
0
        private static List <Dynasty> GetDynastyListByCulture(Dictionary <int, Dynasty> availDynasties, Culture.Culture cul)
        {
            List <Dynasty> dynList = new List <Dynasty>();

            foreach (var d in availDynasties)
            {
                if (d.Value.Culture == cul)
                {
                    dynList.Add(d.Value);
                }
            }

            return(dynList);
        }
Ejemplo n.º 4
0
 public Dynasty GetDynastyByCulture(Culture.Culture cul, Random rand)
 {
     return(GetDynastyByCulture(Dynasties, cul, rand));
 }