unit.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #pragma once
  2. #include <iostream>
  3. #include <vector>
  4. class Spell {
  5. //empty for allow to compile
  6. };
  7. class Unit {
  8. protected:
  9. std::vector <Spell> skills_;
  10. private:
  11. //personal growth
  12. double experience_;
  13. double level_;
  14. //connect with events
  15. double active_points_;
  16. double initiative_;
  17. //movement
  18. std::pair <int, int> location_; //x - first, y - second
  19. double movement_speed_;
  20. //attack action
  21. double agility_;
  22. double attack_range_;
  23. double damage_per_hit_;
  24. double energy_points_; //for physical attacks
  25. double intelligence_;
  26. double mana_points_; //for magic attacks
  27. double strength_;
  28. //durability
  29. double health_points_;
  30. double magic_defence_; //less or equal 40
  31. double physic_defence_; //less or equal 40
  32. public:
  33. Unit();
  34. virtual ~Unit() = delete;
  35. double getExperience();
  36. void setExperience(double value);
  37. double getLevel();
  38. void setLevel(double value);
  39. double getHealthPoints();
  40. void setHealthPoints(double value);
  41. double getManaPoints();
  42. void setManaPoints(double value);
  43. double getEnergyPoints();
  44. void setEnergyPoints(double value);
  45. double getActivePoints();
  46. void setActivePoints(double value);
  47. double getAttackRange();
  48. void setAttackRange(double value);
  49. std::pair<int, int> getLocation();
  50. void setLocation(double x, double y);
  51. double getMovementSpeed();
  52. void setMovementSpeed(double value);
  53. double getInitiative_();
  54. void setInitiative_(double value);
  55. double getDamagePerHit();
  56. void setDamagePerHit(double value);
  57. double getIntelligence();
  58. void setIntelligence(double value);
  59. double getStrength();
  60. void setStrength(double value);
  61. double getAgility();
  62. void setAgility(double value);
  63. double getMagicDefence();
  64. void setMagicDefence(double value);
  65. double getPhysicDefence();
  66. void setPhysicDefence(double value);
  67. virtual void calculateDamagePerHit();
  68. double reduceIncomingDamage(std::string damageType, int value);
  69. };