unit.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #pragma once
  2. #include <iostream>
  3. #include <vector>
  4. class Spell {
  5. //waiting for a realisation
  6. };
  7. class Cell {
  8. //waiting for a realisation
  9. public:
  10. bool isEmpty() {
  11. return true;
  12. }
  13. std::vector <Cell*> actualPath(Cell* destination) { //the shortest existing path from (*this) to (*destination)
  14. std::vector <Cell*> path;
  15. return path;
  16. }
  17. };
  18. class Unit {
  19. protected:
  20. std::vector <Spell> skills_;
  21. private:
  22. //personal information
  23. int cost_;
  24. double experience_;
  25. double level_;
  26. std::string race_; //lower case
  27. //actions and events
  28. double initiative_;
  29. int activity_points_;
  30. //movement
  31. Cell* location_;
  32. int movement_speed_; //how many cells can move for one activity point
  33. double real_x_;
  34. double real_y_;
  35. //attack action
  36. double agility_;
  37. double attack_range_;
  38. double damage_per_hit_;
  39. double intelligence_;
  40. double strength_;
  41. int attack_cost_; //how many activity points does attack cost
  42. //durability
  43. double health_points_;
  44. double magic_defence_; //less or equal 40
  45. double physic_defence_; //less or equal 40
  46. public:
  47. Unit() = delete;
  48. Unit(std::string path) {
  49. }
  50. virtual ~Unit() = delete;
  51. int getCost();
  52. void setCost(int value);
  53. double getExperience();
  54. void setExperience(double value);
  55. double getLevel();
  56. void setLevel(double value);
  57. double getHealthPoints();
  58. void setHealthPoints(double value);
  59. double getAttackRange();
  60. void setAttackRange(double value);
  61. int getActivityPoints();
  62. void setActivityPoints(int value);
  63. Cell* getLocation();
  64. void setLocation(Cell* to);
  65. int getMovementSpeed();
  66. void setMovementSpeed(int value);
  67. int getAttackCost();
  68. void setAttackCost(int value);
  69. double getInitiative();
  70. void setInitiative(double value);
  71. double getDamagePerHit();
  72. void setDamagePerHit(double value);
  73. double getIntelligence();
  74. void setIntelligence(double value);
  75. double getStrength();
  76. void setStrength(double value);
  77. double getAgility();
  78. void setAgility(double value);
  79. int getAttackPoints();
  80. void setAttackPoints(int value);
  81. double getMagicDefence();
  82. void setMagicDefence(double value);
  83. double getPhysicDefence();
  84. void setPhysicDefence(double value);
  85. std::string getRace();
  86. void setRace(std::string new_race);
  87. double getRealX();
  88. void setRealX(double x);
  89. double getRealY();
  90. void setRealY(double y);
  91. virtual void calculateDamagePerHit();
  92. virtual double reduceIncomingDamage(std::string damageType, int value);
  93. int lenOfActualPath(Cell* destination);
  94. virtual bool canMoveForDistance(int distance);
  95. virtual bool canMoveToCell(Cell* destination);
  96. virtual void moveToCell(Cell* destination);
  97. virtual bool canAttackForDistance(int distance) = 0;
  98. virtual bool canAttackToCell(Cell* destination) = 0;
  99. virtual bool canAttackUnit(Unit* target) = 0;
  100. };