示例#1
0
        public void DoBattle(Herd herd, Fleet fleet) // master method
        {
            while (herd.herdHealth > 0 && fleet.fleetHealth > 0)
            {
                FleetAttackResults(herd, fleet);
                if (herd.herdHealth > 0)
                {
                    HerdAttackResults(fleet, herd);
                }
            }
            if (fleet.fleetHealth > 0)
            {
                Console.WriteLine("Winner is Team Robot ");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("Winner is Team Dinosaur ");
                Console.ReadLine();
            }


            //Console.WriteLine(fleet.WarriorList[0].robotName);
        }
示例#2
0
 public void HerdAttackResults(Fleet fleet, Herd herd)
 {
     fleet.fleetHealth = fleet.fleetHealth - herd.herdHealth;
     Console.WriteLine("Fleet health = " + fleet.fleetHealth);
     Console.ReadLine();
 }
示例#3
0
 public void FleetAttackResults(Herd herd, Fleet fleet)
 {
     herd.herdHealth = herd.herdHealth - fleet.fleetAttackPower;
     Console.WriteLine("Herd health = " + herd.herdHealth);
     Console.ReadLine();
 }