So what I want to do is have player classes (classes that the player can choose such as in a RPG. E.g. Archer, Warrior, etc.) and have the information for those player classes automatically be assigned to the player like take for example I create a class and call it Assault or Rifleman. This "Rifleman" has default weapons and attributes that are different from other classes.
Rifleman
Default Primary -> Standard Assault Rifle
Default Secondary -> Standard Handgun
Health = 100
Speed = 2.5 ; Where as an explosive specialist class would be slower or faster.
Take for example, to figure out what the player's current weapon or loadout is, I'd just call this in main.cpp:
Code: Select all
Loadout Assault(); // () anything in side the parenthesis are for the constructor which is apart of what I need help on.
player.pLoadout.SetLoadout(Assault);
I'd like to know of easier ways of doing this. Like should I create derived classes of the Loadout Class and then assign the information in each or just have the instance of the Loadout Class and then assign all the information in a constructor?