Example #1
0
        public void Scavenge()
        {
            string[] resources = { "wood", "water", "watersource", "nothing", "nothing", "death" };
            int      r         = rng.Next(resources.Count());
            string   choice    = resources[r];
            int      amount    = rng.Next(2, 6);

            //Console.WriteLine(choice);
            switch (choice)
            {
            case "wood":
                Console.WriteLine(name + " found " + amount + " " + choice);
                ChopWood(amount);
                break;

            case "water":
                Console.WriteLine(name + " found " + amount + " " + choice);
                findWater(amount);
                break;

            case "nothing":
                Console.WriteLine(name + " found nothing");
                break;

            case "death":
                Console.WriteLine(name + " died");
                homeCity.killPerson(this);
                break;

            default:
                Scavenge();
                break;
            }
        }