Ejemplo n.º 1
0
 public int DoAction(Soldier Attacker, Soldier Defender, string action)
 {
     if(action == "Shoot")
     {
         return Defender.TakeDamage(Attacker.Shoot());       
     }
     else if(action == "Throw")
     {
         return Defender.TakeDamage(Attacker.Throw());
     }
     else if (action == "Heal")
     {
         Attacker.Heal();
     }
     else if (action == "Aim")
     {
         Attacker.Aim();
     }
     return 0;
 }
Ejemplo n.º 2
0
 public Battle(string enemy)
 {
     Player1 = new Soldier("You");
     Player2 = new Soldier(enemy);
 }
Ejemplo n.º 3
0
 public Battle()
 {
     Player1 = new Soldier("You");
     Player2 = new Soldier("Computer");
     badGuy = new ComputerEnemy();
 }