spell.h 1.4 KB

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