I have a PlayerClass class that is used to set my Player's class. For instance, this will make him a warrior:
PlayerClass warrior = new WarriorClass();
WarriorClass will instantiate abilities like so:
Ability ability1 = new LeapAbility();
Now my problem is that I will eventually dynamically update my Warrior's abilities (think talent trees or perks).
So say I give warrior a list of abilities to use. How do I do this in code? Right now I need to know the Abilities before hand and hard code their instantiation in.
Put another way, how do I instantiate a dynamic list of objects? I'm open to other solutions too if this doesn't make sense or is impossible.