effect.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. virtual void OperateOnUnitToCell(Unit* who, Cell* where) = 0;
  40. protected:
  41. int count_;
  42. int durability_;
  43. // GUI values
  44. QString effect_name_;
  45. QString effect_descr_;
  46. QImage effect_icon_;
  47. };
  48. #endif //THE_GAME_EFFECT_H