spellsmanager.h 868 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef SPELLSMANAGER_H
  2. #define SPELLSMANAGER_H
  3. #include <QObject>
  4. #include <QString>
  5. #include <QImage>
  6. #include <vector>
  7. #include "abstractfactory.h"
  8. #include "effects/effect.h"
  9. #include "spells/spell.h"
  10. class SpellManager : public QObject
  11. {
  12. Q_OBJECT
  13. public:
  14. std::shared_ptr<Spell> createSpell(QString spell_name);
  15. std::shared_ptr<Effect> createEffect(QString effect_name);
  16. static SpellManager& getInstance(){
  17. static SpellManager instance;
  18. return instance;
  19. }
  20. private:
  21. SpellManager();
  22. SpellManager(const SpellManager&) = delete;
  23. SpellManager &operator=(SpellManager&) = delete;
  24. ObjectFactory<Spell, QString> spells_factory_;
  25. ObjectFactory<Effect, QString> effects_factory_;
  26. std::vector<QString> available_spells_list_;
  27. std::vector<std::shared_ptr<Unit>> all_spells_list_;
  28. };
  29. #endif // SPELLSMANAGER_H