spell.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // Created by IgorBat on 17.03.2018.
  3. //
  4. #ifndef THE_GAME_SPELL_H
  5. #define THE_GAME_SPELL_H
  6. #pragma once
  7. #include <iostream>
  8. #include <vector>
  9. #include <list>
  10. #include "cell.h"
  11. #include "units/unit.h"
  12. //#include "AbstractFactory.h"
  13. #include "effects/effect.h"
  14. class Spell : public QObject {
  15. Q_OBJECT
  16. protected:
  17. std :: vector <Effect*> effects_;
  18. private:
  19. int distance_;
  20. bool forCell_;
  21. public:
  22. explicit Spell(QString parameters);
  23. virtual ~Spell() {}
  24. int getDistance();
  25. void setDistance(int value);
  26. bool getForCell();
  27. void setForCell(bool value);
  28. virtual bool canCastToCell(Cell* destination, Cell* from);
  29. bool isNeirbor(Cell* destination, Cell* from);
  30. virtual void CastSpell(Cell* from, Cell* where, Unit* who, Unit* whom) = 0;
  31. QString getSpellName() const;
  32. QString getSpellDescr() const;
  33. QImage getSpellIcon() const;
  34. //---------------------------------------------//
  35. //-----------Parameters load section-----------//
  36. //---------------------------------------------//
  37. private:
  38. void loadSpellTraits(QString spell_folder);
  39. void loadSpellDescr(QString spell_folder);
  40. void loadSpellIcon(QString spell_folder);
  41. // GUI values
  42. QString spell_name_;
  43. QString spell_descr_;
  44. QImage spell_icon_;
  45. };
  46. #endif //THE_GAME_SPELL_H