Sfoglia il codice sorgente

added maxhealth point and methon for it

igorbat99 6 anni fa
parent
commit
3b8b49e7ad
2 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  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_;
 }