What would be a good way to code up a character class?
Right now I have this:
Entity
Character Extends Entity
Dwarf, Elf and Human all Extend Entity.
This works pretty well. But each race can have skills (some different)
Each race can also have different classes and different classes can have different skills.
Right now I have Classes and Skills as their own classes/objects and add them to race.
Inside Character I have an “array” of skills and classes. It’s kind of muddled though because classes can add skills.
Is there a better way to design this?
A small example:
Dwarf has Defend skills.
Elf has no skills.
Fighter has Attack and Defend skill.
Mage has no skill.
A dwarf fighter would have Attack and 2+Defend.
Mage Elf would have none
Fighter Elf would have Attack and Defend.
Right now all this info is spread all over the place.
I can’t extend the Classes ontop of Race cause each race could be any class.