Browse Source

added parent/child specs

noath 6 years ago
parent
commit
602a2e71b9
2 changed files with 26 additions and 5 deletions
  1. 16 3
      unit.cpp
  2. 10 2
      unit.h

+ 16 - 3
unit.cpp

@@ -15,6 +15,22 @@ void Unit::setCost(int value){
 	cost_ = value;
 }
 
+std::string Unit::getParentSpec(){
+	return parent_spec_;
+}
+
+void Unit::setParentSpec(std::string specId){
+	parent_spec_ = specId;
+}
+
+std::vector<std::string> Unit::getUpgradeSpecs(){
+	return upgrade_specs_;
+}
+
+void Unit::setUpgradeSpecs(std::vector<std::string> specs){
+	upgrade_specs_ = specs;
+}
+
 double Unit::getExperience() {
 	return experience_;
 }
@@ -191,6 +207,3 @@ int main() {
 	std::cout << "Hello, world!\n";
 }
 
-bool MeleeUnit::canAttackForDistance(int distance) {	
-//	if 
-}

+ 10 - 2
unit.h

@@ -3,7 +3,7 @@
 #include <vector>
 
 class Spell {
-	//waiting for a realisation
+	//waiting
 };
 class Cell {
 	//waiting for a realisation
@@ -25,6 +25,8 @@ protected:
 private:
 	//personal information
 	int cost_;
+	std::string parent_spec_;
+	std::vector<std::string> upgrade_specs_;
 	double experience_;
 	double level_;
 	std::string race_; //lower case
@@ -62,6 +64,12 @@ public:
 	int getCost();
 	void setCost(int value);
 
+	std::string getParentSpec();
+	void setParentSpec(std::string specId);
+
+	std::vector<std::string> getUpgradeSpecs();
+	void setUpgradeSpecs(std::vector <std::string> specs);
+
 	double getExperience();
 	void setExperience(double value);
 
@@ -130,7 +138,7 @@ public:
 	virtual bool canMoveToCell(Cell* destination);
 
 	virtual void moveToCell(Cell* destination);
-	
+
 	virtual	bool canAttackForDistance(int distance) = 0;
 
 	virtual bool canAttackToCell(Cell* destination) = 0;