|
@@ -18,20 +18,18 @@ class Unit{
|
|
class Cell{
|
|
class Cell{
|
|
std :: list <Effect> effectsOnCell;
|
|
std :: list <Effect> effectsOnCell;
|
|
};
|
|
};
|
|
-class Spell {
|
|
|
|
|
|
+class Spell : public QObject {
|
|
|
|
+ Q_OBJECT
|
|
|
|
|
|
protected:
|
|
protected:
|
|
std :: list <Effect> effects_;
|
|
std :: list <Effect> effects_;
|
|
-
|
|
|
|
private:
|
|
private:
|
|
int distance_;
|
|
int distance_;
|
|
bool forCell_;
|
|
bool forCell_;
|
|
public:
|
|
public:
|
|
- Spell() = delete;
|
|
|
|
- Spell(std::string path) {
|
|
|
|
|
|
+ explicit Spell(QString parameters);
|
|
|
|
|
|
- }
|
|
|
|
- virtual ~Spell() = delete;
|
|
|
|
|
|
+ virtual ~Spell() {}
|
|
|
|
|
|
int getDistance();
|
|
int getDistance();
|
|
void setDistance(int value);
|
|
void setDistance(int value);
|
|
@@ -39,14 +37,32 @@ public:
|
|
bool getForCell();
|
|
bool getForCell();
|
|
void setForCell(bool value);
|
|
void setForCell(bool value);
|
|
|
|
|
|
- //int lenOfSmallestPath(Cell* destination);
|
|
|
|
|
|
+ virtual bool canCastToCell(Cell* destination, Cell* from);
|
|
|
|
+
|
|
|
|
+ virtual void CastSpell(Cell* from, Cell* where, Unit* who, Unit* whom) = 0;
|
|
|
|
|
|
- virtual bool canCastForDistance(int distance);
|
|
|
|
|
|
+ int getDistance();
|
|
|
|
+ void setDistance(int Value);
|
|
|
|
|
|
- virtual bool canCastToCell(Cell* destination);
|
|
|
|
|
|
+ bool getForCell();
|
|
|
|
+ void setForCell(bool Value);
|
|
|
|
|
|
- virtual void castToCell(Cell* destination);
|
|
|
|
|
|
+ QString getSpellName() const;
|
|
|
|
+ QString getSpellDescr() const;
|
|
|
|
+ QImage getSpellIcon() const;
|
|
|
|
+
|
|
|
|
+ //---------------------------------------------//
|
|
|
|
+ //-----------Parameters load section-----------//
|
|
|
|
+ //---------------------------------------------//
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ void loadSpellTraits(QString spell_folder);
|
|
|
|
+ void loadSpellDescr(QString spell_folder);
|
|
|
|
+ void loadSpellIcon(QString spell_folder);
|
|
|
|
|
|
- void CastSpell(Cell* from, Cell* where, Unit* who, Unit* whom);
|
|
|
|
|
|
+ // GUI values
|
|
|
|
+ QString spell_name_;
|
|
|
|
+ QString spell_descr_;
|
|
|
|
+ QImage spell_icon_;
|
|
};
|
|
};
|
|
#endif //THE_GAME_SPELL_H
|
|
#endif //THE_GAME_SPELL_H
|