title: Declare Class Level Variables in Child Class
body: <p>I would like to declare class level variables for a bunch of child classes similar to this in python: <a href="https://stackoverflow.com/questions/68645/static-class-variables-in-python">Static class variables in Python</a>.  I've learned that the <code>shared</code> attributed is probably what I want to use, but I'm not quite sure where to use it.</p>
  
  <p>Here's my situation:  I am making a bunch of different character types for a game (100+).  All the character types have the same set of properties, so I've created a base class that includes all of the properties and the required internal variables.  Each character type has a set of immutable properties that are exactly the same for every instance of the given character type, but differ between character types.  I would like to contain the immutable character type properties as class "variables" in child classes (one child class per character type), like in the answer to the python example above.  </p>
  
  <p>The key is I would like to reference some properties WITHOUT having to create an instance of the sub class.</p>
  
  <p>My problem is I can't figure out what needs to be shared to properly do this or how my code needs to be organized to make this happen.  I tried sharing the properties which finally allowed me to get to the properties from the child class and not just an instance of the child, but then it wouldn't return the property I assigned in the child class using <code>Shared</code> or <code>Shared Shadows</code>.  I would like to keep the properties in the base class so that I don't have to copy and paste the same properties for every child class.</p>
  
  <p>Here is some samples of my code:</p>
  
  <pre><code>Public MustInherit Class Char
  
      'IMMUTABLE INFORMATION
      '  CharType Traits
      Shared _ID As Integer
      Shared _Species As String
  
      Public Shared ReadOnly Property Species As String
          Get
              Return _Species
          End Get
      End Property
  End Class
  
  Public Class CharCat
      Inherits Char
  
      Shared Shadows _Species = "Cat"
  End Class
  </code></pre>
  
  <p>The goal is to be able to type <code>CharCat.Species</code> and have it return <code>"Cat"</code>.  I know this example is redundant with the class name, but for other properties it's not.</p>