Esempio n. 1
0
        private void RefreshItems()
        {
            this.Items = new List <Item>()
            {
                new Item()
                {
                    Name = Config.Material, Count = Helper.Rand.Next(1, Config.WoodSellCount + 1)
                }
            };

            this.Foods = new List <Item>();
            int count = Helper.Rand.Next(1, Config.SellFoodCount + 1);

            for (int x = 0; x < count; x++)
            {
                PlantType plant = Helper.GetRandomPlantType();
                while (plant.Food < 1)
                {
                    plant = Helper.GetRandomPlantType();
                }

                Foods.Add(new Item()
                {
                    Name = plant.Name, Count = Helper.Rand.Next(1, Config.FoodSellCount + 1)
                });
            }

            this.Seeds = new List <Item>();
            count      = Helper.Rand.Next(1, Config.SellSeedCount + 1);
            for (int x = 0; x < count; x++)
            {
                PlantType plant = Helper.GetRandomPlantType();
                Seeds.Add(new Item()
                {
                    Name = plant.Name, Count = Helper.Rand.Next(1, Config.SeedSellCount + 1)
                });
            }
        }
Esempio n. 2
0
 public Plant(PlantType plantType)
 {
     this.PlantType = plantType;
 }