effect.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 "AbstractFactory.h"
  10. class Unit;
  11. class Cell;
  12. class Effect : public QObject {
  13. Q_OBJECT
  14. public:
  15. explicit Effect(QString parameters);
  16. virtual ~Effect() {}
  17. int getCount();
  18. void setCount(int value);
  19. int getDurability;
  20. void setDurability(int value);
  21. //---------------------------------------------//
  22. //----------------GUI section------------------//
  23. //---------------------------------------------//
  24. QString getUnitId() const;
  25. QString getUnitName() const;
  26. QString getUnitDescr() const;
  27. QString getUnitBaseClassId() const;
  28. std::vector<QString> getUnitTraits() const;
  29. QImage getUnitIcon() const;
  30. //---------------------------------------------//
  31. //-----------Parameters load section-----------//
  32. //---------------------------------------------//
  33. private:
  34. void loadUnitName(QString unit_folder);
  35. void loadUnitDescr(QString unit_folder);
  36. void loadUnitBaseClass(QString unit_folder);
  37. void loadUnitTraits(QString unit_folder);
  38. void loadUnitIcon(QString unit_folder);
  39. void loadUnitPrevSpecs(QString unit_folder);
  40. void loadUnitUpgradeSpecs(QString unit_folder);
  41. public:
  42. virtual void OperateOnCell(Cell*) = 0;
  43. virtual void OperateOnUnit(Unit*) = 0;
  44. protected:
  45. int count_;
  46. int durability_;
  47. // GUI values
  48. QString race_id_;
  49. QString unit_id_;
  50. QString unit_name_;
  51. QString unit_descr_;
  52. QString base_class_id_;
  53. QImage unit_icon_;
  54. };
  55. #endif //THE_GAME_EFFECT_H