Exemplo n.º 1
0
        public City(string aCityName, int aPopulation, RollGeneration aRollGenerator, ModifyStats aStatModifier)
        {
            InitializedRoller = aRollGenerator;
            statModifier      = aStatModifier;

            generator      = new CityGeneration();
            Population     = aPopulation;
            BuildingAmount = generator.rollBuildings(Population);
            HouseAmount    = generator.rollHouses(Population);
            CityName       = aCityName;
            houses         = new List <House>();
            CitizenList    = new PersonList();
            Buildings      = new List <Building>();
        }
Exemplo n.º 2
0
        public bool generatePopulation(int population, City givenCity, RollGeneration peopleRoller, ModifyStats statModifier)
        {
            PersonList citizenlist = givenCity.CitizenList;

            while (citizenlist.Citizens.Count <= population)
            {
                Person founderPerson = new Person(peopleRoller, statModifier);
                citizenlist.Citizens.Add(founderPerson);
                generateFamilyTree(founderPerson, givenCity, "default", 0);
            }
            return(true);
        }