Browse Source

Interfaces

igorbat99 6 năm trước cách đây
mục cha
commit
2df12b5b2c
2 tập tin đã thay đổi với 26 bổ sung4 xóa
  1. 15 1
      include/skills/effect.h
  2. 11 3
      include/skills/spell.h

+ 15 - 1
include/skills/effect.h

@@ -9,12 +9,19 @@
 #include <iostream>
 #include <vector>
 //#include "AbstractFactory.h"
-enum typeEffect{damage, strength};
+
+class Unit;
+class Cell;
+
+enum typeEffect{instancePoint, ongoingPoint, instanceUnit, ongoingUnit};
+enum specieEffect{agility_, attack_range_, damage_per_hit_, intelligence_};
+
 class Effect {
 
 private:
     int count_;
     typeEffect typeEffect_;
+    specieEffect specieEffect_;
 public:
     Effect() = delete;
     Effect(std::string path) {
@@ -27,5 +34,12 @@ public:
 
     typeEffect getType();
     void setType(typeEffect value);
+
+    specieEffect getSpecie();
+    void setSpecie(specieEffect value);
+
+    void OperateOnCell(Cell*);
+    void OperateOnUnit(Unit*);
+    //logic here. 
 };
 #endif //THE_GAME_EFFECT_H

+ 11 - 3
include/skills/spell.h

@@ -8,14 +8,20 @@
 #pragma once
 #include <iostream>
 #include <vector>
+#include <list>
 //#include "AbstractFactory.h"
 #include "effect.h"
-class Cell;
 
+class Unit{
+    std :: list <Effect> effectsOnUnit;
+};
+class Cell{
+    std :: list <Effect> effectsOnCell;
+};
 class Spell {
 
 protected:
-    std::vector <Effect> effects_;
+    std :: list <Effect> effects_;
 
 private:
     int distance_;
@@ -33,12 +39,14 @@ public:
     bool getForCell();
     void setForCell(bool value);
 
-    int lenOfActualPath(Cell* destination);
+    //int lenOfSmallestPath(Cell* destination);
 
     virtual bool canCastForDistance(int distance);
 
     virtual bool canCastToCell(Cell* destination);
 
     virtual void castToCell(Cell* destination);
+
+    void CastSpell(Cell* from, Cell* where, Unit* who, Unit* whom);
 };
 #endif //THE_GAME_SPELL_H