spell.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include <memory>
  15. class Spell : public QObject {
  16. Q_OBJECT
  17. protected:
  18. std :: vector <std::shared_ptr<Effect> > effects_;
  19. private:
  20. int distance_;
  21. bool forCell_;
  22. public:
  23. explicit Spell(QString parameters);
  24. virtual ~Spell() {}
  25. int getDistance();
  26. void setDistance(int value);
  27. bool getForCell();
  28. void setForCell(bool value);
  29. virtual bool canCastToCell(Cell* destination, Cell* from) = 0;
  30. bool isNeirbor(Cell* destination, Cell* from);
  31. virtual void CastSpell(Cell* from, Cell* where, Unit* who, Unit* whom) = 0;
  32. QString getSpellName() const;
  33. QString getSpellDescr() const;
  34. QImage getSpellIcon() const;
  35. //---------------------------------------------//
  36. //-----------Parameters load section-----------//
  37. //---------------------------------------------//
  38. private:
  39. void loadSpellTraits(QString spell_folder);
  40. void loadSpellDescr(QString spell_folder);
  41. void loadSpellIcon(QString spell_folder);
  42. // GUI values
  43. QString spell_name_;
  44. QString spell_descr_;
  45. QImage spell_icon_;
  46. };
  47. #endif //THE_GAME_SPELL_H