spell.h 1.2 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. virtual void CastSpell(Cell* from, Cell* where, Unit* who, Unit* whom) = 0;
  30. QString getSpellName() const;
  31. QString getSpellDescr() const;
  32. QImage getSpellIcon() const;
  33. //---------------------------------------------//
  34. //-----------Parameters load section-----------//
  35. //---------------------------------------------//
  36. private:
  37. void loadSpellTraits(QString spell_folder);
  38. void loadSpellDescr(QString spell_folder);
  39. void loadSpellIcon(QString spell_folder);
  40. // GUI values
  41. QString spell_name_;
  42. QString spell_descr_;
  43. QImage spell_icon_;
  44. };
  45. #endif //THE_GAME_SPELL_H