コード例 #1
0
ファイル: Program.cs プロジェクト: jordanHS/plant-grower
        public static void BadStuff(Plant plant, int chance)
        {
            switch (chance)
            {
            case 1:
                plant.Windstorm();
                Console.WriteLine("-------------------------------");
                Console.WriteLine("A windstorm occured, {0} lost 1 health. Leaving them at {1} health.", plant.PlantName, plant.PlantHealth);
                break;

            case 2:
                plant.AphidAttack();
                Console.WriteLine("-------------------------------");
                Console.WriteLine("Aphids attacked, {0} lost 3 health. Leaving them at {1} health.", plant.PlantName, plant.PlantHealth);
                break;

            case 3:
                plant.SlugBite();
                Console.WriteLine("-------------------------------");
                Console.WriteLine("A slug bit {0}, they lost 2 health. Leaving them at {1} health.", plant.PlantName, plant.PlantHealth);
                break;

            default:
                break;
            }
        }