igorbat99 6 gadi atpakaļ
vecāks
revīzija
0ce676c818

+ 1 - 0
assets/effects/effects.txt

@@ -0,0 +1 @@
+Effect of instance heal to Unit.

+ 1 - 0
assets/effects/melledamage/descr.txt

@@ -0,0 +1 @@
+Effect of instance damage to Unit.

+ 2 - 0
assets/skills/melledamage/traits.txt

@@ -0,0 +1,2 @@
+1
+melledamage|10|0

+ 2 - 0
assets/skills/selfheal/traits.txt

@@ -0,0 +1,2 @@
+1
+selfheal|5|0

+ 43 - 10
include/effects/effect.h

@@ -13,24 +13,57 @@
 class Unit;
 class Cell;
 
+class Effect : public QObject {
+    Q_OBJECT
 
-class Effect {
-
-private:
-    int count_;
-    int durability_;
 public:
-    Effect() = delete;
-    Effect(std::string path) {
+    explicit Effect(QString parameters);
 
-    }
-    virtual ~Effect() = delete;
+    virtual ~Effect() {}
 
     int getCount();
     void setCount(int value);
 
+    int getDurability;
+    void setDurability(int value);
+
+    //---------------------------------------------//
+    //----------------GUI section------------------//
+    //---------------------------------------------//
+
+    QString getUnitId() const;
+    QString getUnitName() const;
+    QString getUnitDescr() const;
+    QString getUnitBaseClassId() const;
+    std::vector<QString> getUnitTraits() const;
+    QImage getUnitIcon() const;
+
+    //---------------------------------------------//
+    //-----------Parameters load section-----------//
+    //---------------------------------------------//
+
+private:
+    void loadUnitName(QString unit_folder);
+    void loadUnitDescr(QString unit_folder);
+    void loadUnitBaseClass(QString unit_folder);
+    void loadUnitTraits(QString unit_folder);
+    void loadUnitIcon(QString unit_folder);
+    void loadUnitPrevSpecs(QString unit_folder);
+    void loadUnitUpgradeSpecs(QString unit_folder);
+public:
     virtual void OperateOnCell(Cell*) = 0;
     virtual void OperateOnUnit(Unit*) = 0;
-    //logic here.
+protected:
+    int count_;
+    int durability_;
+
+    // GUI values
+    QString race_id_;
+    QString unit_id_;
+
+    QString unit_name_;
+    QString unit_descr_;
+    QString base_class_id_;
+    QImage unit_icon_;
 };
 #endif //THE_GAME_EFFECT_H