Преглед изворни кода

added maxhealth point and methon for it

igorbat99 пре 6 година
родитељ
комит
3b8b49e7ad
2 измењених фајлова са 7 додато и 0 уклоњено
  1. 3 0
      include/units/unit.h
  2. 4 0
      source/units/unit.cpp

+ 3 - 0
include/units/unit.h

@@ -41,6 +41,8 @@ public:
     int getHealthPoints();
     void setHealthPoints(int);
 
+    int getMaxHealthPoints();
+
     int getMagicDefence();
     int getPhysicDefence();
 
@@ -175,6 +177,7 @@ protected:
 
     //durability
     int health_points_;
+    int max_health_points_;
     int magic_defence_;  //less or equal 40
     int physic_defence_; //less or equal 40
 

+ 4 - 0
source/units/unit.cpp

@@ -121,6 +121,10 @@ int Unit::getHealthPoints() {
 	return health_points_;
 }
 
+int Unit::getMaxHealthPoints() {
+    return max_health_points_;
+}
+
 int Unit::getAttackRange() {
 	return attack_range_;
 }