fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. class Skill
  5. {
  6. public:
  7. std::string skillName;
  8. };
  9.  
  10. class AttackSkill :
  11. public Skill
  12. {
  13.  
  14. public:
  15. int dmgMod;
  16. int baseAcc;
  17. };
  18.  
  19. class Axeblade :
  20. public AttackSkill
  21. {
  22. public:
  23. Axeblade()
  24. {
  25. skillName = "Axeblade";
  26. dmgMod = 0;
  27. baseAcc = 72;
  28. }
  29. };
  30.  
  31. class SkillSet
  32. {
  33. public:
  34. std::vector <AttackSkill *> attacks;
  35. // std::vector <UtilitySkill *> utilities;
  36. // std::vector <MoveSkill *> movement;
  37. };
  38.  
  39.  
  40. int main() {
  41. SkillSet hero0;
  42. hero0.attacks.push_back(new Axeblade);
  43. std::cout << hero0.attacks[0]->skillName;
  44. // your code goes here
  45. return 0;
  46. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
Axeblade