effect.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. enum TypeOfTrigger{
  19. InCome = 1,
  20. AfterAction = 2,
  21. AfterEndTurn = 3
  22. };
  23. explicit Effect(QString parameters);
  24. virtual ~Effect() {}
  25. int getCount();
  26. void setCount(int value);
  27. int getDurability();
  28. void setDurability(int value);
  29. //---------------------------------------------//
  30. //----------------GUI section------------------//
  31. //---------------------------------------------//
  32. QString getEffectName() const;
  33. QString getEffectDescr() const;
  34. QImage getEffectIcon() const;
  35. //---------------------------------------------//
  36. //-----------Parameters load section-----------//
  37. //---------------------------------------------//
  38. private:
  39. void loadEffectDescr(QString effect_folder);
  40. void loadEffectIcon(QString effect_folder);
  41. public:
  42. virtual void OperateOnCell(Cell* cell) = 0;
  43. virtual void OperateOnUnit(Unit* unit) = 0;
  44. virtual void OperateOnUnitToCell(Unit* who, Cell* where) = 0;
  45. virtual void Execute(Cell* from, Cell* where, Unit* who, Unit* whom, TypeOfTrigger Type) = 0;
  46. protected:
  47. int count_;
  48. int durability_;
  49. // GUI values
  50. QString effect_name_;
  51. QString effect_descr_;
  52. QImage effect_icon_;
  53. };
  54. #endif //THE_GAME_EFFECT_H