Effect.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // Created by IgorBat on 17.03.2018.
  3. //
  4. #ifndef THE_GAME_EFFECT_H
  5. #define THE_GAME_EFFECT_H
  6. #pragma once
  7. #include <iostream>
  8. #include <vector>
  9. #include <QFile>
  10. #include <QString>
  11. #include <QTextStream>
  12. #include <QImage>
  13. class Unit;
  14. class Cell;
  15. class Effect : public QObject {
  16. Q_OBJECT
  17. public:
  18. explicit Effect(QString parameters);
  19. virtual ~Effect() {}
  20. int getCount();
  21. void setCount(int value);
  22. int getDurability();
  23. void setDurability(int value);
  24. //---------------------------------------------//
  25. //----------------GUI section------------------//
  26. //---------------------------------------------//
  27. QString getEffectName() const;
  28. QString getEffectDescr() const;
  29. QImage getEffectIcon() const;
  30. //---------------------------------------------//
  31. //-----------Parameters load section-----------//
  32. //---------------------------------------------//
  33. private:
  34. void loadEffectDescr(QString effect_folder);
  35. void loadEffectIcon(QString effect_folder);
  36. public:
  37. virtual void OperateOnCell(Cell* cell) = 0;
  38. virtual void OperateOnUnit(Unit* unit) = 0;
  39. protected:
  40. int count_;
  41. int durability_;
  42. // GUI values
  43. QString effect_name_;
  44. QString effect_descr_;
  45. QImage effect_icon_;
  46. };
  47. #endif //THE_GAME_EFFECT_H