When does a class warrant a sub-class?
<p>For example, I am trying to build an enemy class for a simple game. Each <em>enemy</em> that spawns has a <em>type</em> which affects it stats which are fields in the <em>enemy</em> class.</p>

<pre><code>class Enemy:
    #Base Stats for all enemies
    name = "foo"
    current_health = 4
    max_health = 4
    attack = 0
    defense = 0
    armor = 0
    initiative = 0
    initMod = 0
    alive = True
</code></pre>

<p>Should each <em>type</em> be a <strong>subclass</strong> of <em>enemy</em> like so..</p>

<pre><code>class goblin(Enemy):
    name = goblin;
    current_health = 8
    max_health = 8
    attack = 3
    defense = 2
    armor = 0

    def attack(){
        //goblin-specific attack
    }
</code></pre>

<p>But this method means that I would have to build a class for each individual <em>type</em> (which would be 80+ classes), or is there a better way to do it? This <em>enemy</em> is going to be randomized, so I was thinking the <em>types</em> could also be put into a <strong>dictionary</strong> which uses the names of the <em>types</em> as keywords. Although I'm not entirely sure how I could implement that.</p>