Advertisement
Guest User

For my boyfriend

a guest
Feb 19th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #pragma once
  2. class Hero
  3. {
  4. private:
  5. int hp, max_hp, defense, attack, cp, max_cp, speed, lvl;
  6. string name;
  7.  
  8. public:
  9. Hero(){
  10. hp = 0;
  11. max_hp = 0;
  12. defense = 0;
  13. attack = 0;
  14. cp = 0;
  15. max_cp = 0;
  16. speed = 0;
  17. lvl = 0;
  18. name = "";
  19. };
  20. Hero (int hp, int defense, int attack, int cp, int speed, int lvl, string name)
  21. {
  22. this->hp = hp;
  23. max_hp = hp;
  24. this->defense = defense;
  25. this->attack = attack;
  26. this->cp = cp;
  27. this->speed = speed;
  28. this->lvl = lvl;
  29. this->name = name;
  30. }
  31. int get_hp() { return hp; }
  32. int get_defense() { return defense; }
  33. int get_attack() { return attack; }
  34. int get_cp() { return cp; }
  35. int get_speed() { return speed; }
  36. int get_lvl() { return lvl; }
  37. string get_name() { return name; }
  38. string get_info() {
  39. string info = name + ": " + to_string(hp) + "/" + to_string(max_hp) + "\nAttk:\t" + to_string(attack) + "\nDef:\t" + to_string(defense) + "\nSpd:\t" + to_string(speed) + "\n";
  40. return info;
  41. }
  42.  
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement