Exemplo n.º 1
0
        public Fleet()
        {
            TheRobots = new List <Robots>();
            Robots somerobots  = new Robots(" Alpha ");
            Robots somerobots1 = new Robots(" Bravo");
            Robots somerobots2 = new Robots("Charlie");

            TheRobots.Add(somerobots);
            TheRobots.Add(somerobots1);
            TheRobots.Add(somerobots2);
        }
Exemplo n.º 2
0
 public void Attack(Robots RobotToAttack)
 {
     RobotToAttack.robotHealth -= dinoAttackPower;
     if (RobotToAttack.robotHealth == 0)
     {
         Console.WriteLine(" Death");
     }
     else
     {
         RobotToAttack.robotHealth -= dinoAttackPower;
     }
     if (dinoEnergy == 0)
     {
         Console.WriteLine(" Needs Power");
     }
     else
     {
         dinoEnergy -= dinoAttackPower;
     }
 }