title: Calling class in a class?
body: <p>I'm new.</p>
  
  <p>my problem:</p>
  
  <pre><code>class Battle
  {
      public void Fight(string charOne, string charTwo)
      {
          void CurrentHealth()
          {
              Console.WriteLine(charOne.name + "'s Health: " + 
                  charOne.currentHealth + "/" + charOne.maxHealth + 
                  "   |   " + charTwo.name + "'s Health: " + charTwo.currentHealth + 
                  "/" + charTwo.maxHealth);
          }
      }
  }
  </code></pre>
  
  <p>the ".name" and ".currentHealth" are not working.
  charOne would be a class instance, and charTwo would be another class instance.</p>
  
  <p>[UPDATE BELOW]</p>
  
  <p>Below was the code that was originally working in the main program class, and I was trying to move it in to a class, where I could pass in some parameters to the class, so the Hero could fight other monsters in the future. This single time monster was "mosquito".
  I just want to be able to replace a "mosquito" with a "wolf" class and maybe "hero2" instead of "hero". Hope this makes more sense.</p>
  
  <pre><code>                void CurrentHealth()
                  {
                      Console.WriteLine(hero.name + "'s Health: " + hero.currentHealth + "/" + hero.maxHealth + "   |   " + mosquito.name + "'s Health: " + mosquito.currentHealth + "/" + mosquito.maxHealth);
                  }
                  void Attack(int dmg)
                  {
  
                      Console.WriteLine(hero.name + " Dealt " + dmg + " damage to " + mosquito.name + ".");
                  }
  
  
                  while (mosquito.currentHealth &gt; 0 &amp;&amp; hero.currentHealth &gt; 0)
                  {
                      Console.Clear();
                      int damage = hero.AttackAction();
                      mosquito.currentHealth = mosquito.currentHealth - damage;
                      int newHealth = mosquito.currentHealth;
                      Attack(damage);
                      CurrentHealth();
  
                      Console.WriteLine();
                      Console.WriteLine("Press any key to continue.");
                      Console.Read();
  
                  }
                  if (mosquito.currentHealth &lt;= 0)
                  {
                      Console.WriteLine("Right on! You are Victorious!!!");
                  }
                  else if (hero.currentHealth &lt;= 0)
                  {
                      Console.WriteLine("Oh no.. you are dead...");
                  }
                  else
                  {
                      Console.WriteLine("You reached the end.");
                  }
  </code></pre>