title: "Name does not exist in this context" error in a random item generator
body: <p>The goal is to create a random item generator, in this case potions. Everything works fine until I attempt to make the type of potion that is randomly selected actually effect the stats that they increase, which the guide i'm following didn't go over. </p>
  
  <p>The errors say that the names such as HEALTH and ENERGY do not exist in this context, as well as one that says "Cannot implicitly convert type 'void' to 'BasePotion.PotionTypes'"</p>
  
  <p>I'm following a guide to create an rpg to try and learn c#. I've been following it up to this point, but decided to expand upon the code we were doing. 
  I originally had the if statements in their own function, but that gave an "identifier expected" error.</p>
  
  <pre><code>private void CreatePotion() { 
  
      newPotion = new BasePotion();
  
      newPotion.PotionType = ChoosePotionType();
      newPotion.ItemName = newPotion.PotionType.ToString() +" POTION";
      newPotion.ItemID = Random.Range(1,100);
      if (newPotion.PotionType == HEALTH) {
          newPotion.Stamina = Random.Range(1,11);
          newPotion.Endurance = Random.Range(1,11);
          newPotion.Strength = 0;
          newPotion.Intellect = 0;
      }
      else if (newPotion.PotionType == ENERGY){
          newPotion.Stamina = 0;
          newPotion.Endurance = 0;
          newPotion.Strength = Random.Range(1,11);
          newPotion.Intellect = Random.Range(1,11);
      }
      else if (newPotion.PotionType == STAMINA){
          newPotion.Stamina = Random.Range(1,11);
          newPotion.Endurance = 0;
          newPotion.Strength = 0;
          newPotion.Intellect = 0;
      }
      else if (newPotion.PotionType == ENDURANCE){
          newPotion.Stamina = 0;
          newPotion.Endurance = Random.Range(1,11);
          newPotion.Strength = 0;
          newPotion.Intellect = 0;
      }
      else if (newPotion.PotionType == STRENGTH){
          newPotion.Stamina = 0;
          newPotion.Endurance = 0;
          newPotion.Strength = Random.Range(1,11);
          newPotion.Intellect = 0;
      }
      else if (newPotion.PotionType == INTELLECT){
          newPotion.Stamina = 0;
          newPotion.Endurance = 0;
          newPotion.Strength = 0;
          newPotion.Intellect = Random.Range(1,11);
      }
  }
  </code></pre>
  
  <p>The if statements are the lines giving errors.</p>
  
  <p>I don't really know how much is needed to replicate the issue, but here is the BasePotion script this derives from.</p>
  
  <pre><code>public enum PotionTypes {
      HEALTH,
      ENERGY,
      STRENGTH,
      ENDURANCE,
      STAMINA,
      INTELLECT
  }
  
  private PotionTypes potionType;
  private int spellEffectID;
  
  public PotionTypes PotionType {
      get { return potionType; }
      set { potionType = value; }
  }
  
  public int SpellEffectID {
      get { return spellEffectID; }
      set { spellEffectID = value; }
  }
  </code></pre>
  
  <p>I have another, pretty much identical script minus the if statements to generate armor in the same way as this, and that works as expected, including assigning a Type in the same way i am in this script. </p>
  
  <p>I can't really figure out what the issue is, but if anyone has a better way of going about this, that would be helpful too.</p>