title: Declaring class object inside switch statement
body: <p>This is my first time writing code so complex, and I stumbled onto a problem.
  So, I am trying to make a very basic text based RPG, in visual C# using visual studio.
  I have 3 forms up until this point. The main menu form (with play and exit buttons), the character selection form (which opens once you click play), and the game form itself. 
  On the character selection form, the user is prompted to choose its character class (mage, warrior, rogue). 
  I have created a public abstract class called entity:</p>
  
  <pre><code>    public abstract class Entity
  {
      #region Attributes
  
      protected string _name;
      protected int _strength, _strengthModifier,
          _magic, _magicModifier,
          _luck, _luckModifier,
          _defense, _defenseModifier,
          _health, _healthModifier;
  
      #endregion
  
      #region Properties
  
      public string Name
      {
          get { return _name; }
          protected set { _name = value; }
      }
      public int Strength
      {
          get { return _strength; }
          protected set { _strength = value; }
      }
      public int StrengthModifier
      {
          get { return _strengthModifier; }
          protected set { _strengthModifier = value; }
      }
      public int Magic
      {
          get { return _magic; }
          protected set { _magic = value; }
      }
      public int MagicModifier
      {
          get { return _magicModifier; }
          protected set { _magicModifier = value; }
      }
      public int Luck
      {
          get { return _luck; }
          protected set { _luck = value; }
      }
      public int LuckModifier
      {
          get { return _luckModifier; }
          protected set { _luckModifier = value; }
      }
      public int Defense
      {
          get { return _defense; }
          protected set { _defense = value; }
      }
      public int DefenseModifier
      {
          get { return _defenseModifier; }
          protected set { _defenseModifier = value; }
      }
      public int Health
      {
          get { return _health; }
          protected set { _health = value; }
      }
      public int HealthModifier
      {
          get { return _healthModifier; }
          protected set { _healthModifier = value; }
      }
  
      #endregion
  
      #region Constructor
      public Entity()
      {
          Name = "";
          Strength = 0;
          Magic = 0;
          Luck = 0;
          Defense = 0;
          Health = 0;
      }
      #endregion
  
      #region Methods
  
      #endregion
  
  }
  </code></pre>
  
  <p>Then I created warrior class, age class and rogue class with inheritance from this one.</p>
  
  <pre><code>class Mage : Entity
  {
      public Mage(string name) : base()
      {
          _name = name;
  
              #region Stats
          _strength = 0;
          _strengthModifier = 0;
          _magic = 10;
          _magicModifier = 3;
          _luck = 3;
          _luckModifier = 0;
          _defense = 5;
          _defenseModifier = 0;
          _health = 100;
          _healthModifier = 0;
              #endregion
      }
  }
  </code></pre>
  
  <p>Now, I create the class object itself, on the game form. From the character selection form I call the game form and I send players name and class as parameters.</p>
  
  <pre><code>        public Game(string name, string characterClass)
      {
          InitializeComponent();
  
          #region CreateCharacter
  
          switch (characterClass)
          {
              case "Mage":
                  {
                      Mage player = new Mage(name); // create player
  
                      #region PrintPicture
  
                      pbPlayer.Image = Image.FromFile("C:/Users/mircea/Documents/Visual Studio 2015/Projects/RPG/Artwork/Characters/Mage.png");
                      pbPlayer.BackgroundImageLayout = ImageLayout.Center;
                      pbPlayer.Size = new Size(145, 200);
  
                      #endregion
  
                      lblName.Text = player.Name.ToString(); // show player name
                      txtLog.Text += "Welcome to game title, " + name + "!"; // greet log
                      break;
                  }
              case "Rogue":
                  {
                      Rogue player = new Rogue(name); // create player
  
                      #region PrintPicture
  
                      pbPlayer.Image = Image.FromFile("C:/Users/mircea/Documents/Visual Studio 2015/Projects/RPG/Artwork/Characters/Rogue.bmp");
                      pbPlayer.BackgroundImageLayout = ImageLayout.Center;
                      pbPlayer.Size = new Size(145, 200);
  
                      #endregion
  
                      lblName.Text = player.Name.ToString(); // show player name
                      txtLog.Text += "Welcome to game title, " + name + "!"; // greet log
                      break;
                  }
              case "Warrior":
                  {
                      Warrior player = new Warrior(name); // create player
  
                      #region PrintPicture
  
                      pbPlayer.Image = Image.FromFile("C:/Users/mircea/Documents/Visual Studio 2015/Projects/RPG/Artwork/Characters/Warrior.png");
                      pbPlayer.BackgroundImageLayout = ImageLayout.Center;
                      pbPlayer.Size = new Size(145, 200);
  
                      #endregion
  
                      lblName.Text = player.Name.ToString(); //show player name
                      txtLog.Text += "Welcome to game title, " + name + "!"; // greet log
                      break;
                  }
          } 
  
          #endregion
  
  
      }
  </code></pre>
  
  <p>Now. If I try to call player outside of that switch, it wont work. The only solution I can see is to have the code 3 times, once in each case. I am, anyway, 1000% sure that is not the way.
  Any suggestions?</p>