Ejemplo n.º 1
0
 public void GenerateItems()
 {
     Candidates = new ItemList();
     for (int i = 0; i < ItemCount; i++)
     {
         Candidates.Add(new Item()
         {
             Id    = i.ToString(),
             Value = Randomizer.IntInRange(this.ItemValues),
             Size  = Randomizer.IntInRange(this.ItemSizes),
         });
     }
 }
Ejemplo n.º 2
0
        public CityCollection(IRandomizer randomizer, int count, IntegerRange distanceRange)
        {
            for (int i = 0; i < count; i++)
            {
                Cities.Add(new City()
                {
                    Id = i
                });
            }

            foreach (var city in Cities)
            {
                foreach (var otherCities in Cities)
                {
                    city.Roads.Add(new Road()
                    {
                        City = otherCities, Distance = randomizer.IntInRange(distanceRange)
                    });
                }
            }
        }