|
@@ -1,6 +1,6 @@
|
|
#ifndef SPELLSMANAGER_H
|
|
#ifndef SPELLSMANAGER_H
|
|
#define SPELLSMANAGER_H
|
|
#define SPELLSMANAGER_H
|
|
-/*#include <QObject>
|
|
|
|
|
|
+#include <QObject>
|
|
#include <QString>
|
|
#include <QString>
|
|
#include <QImage>
|
|
#include <QImage>
|
|
|
|
|
|
@@ -14,20 +14,19 @@ class SpellManager : public QObject
|
|
{
|
|
{
|
|
Q_OBJECT
|
|
Q_OBJECT
|
|
public:
|
|
public:
|
|
- //explicit Race(QString race_name, QObject *parent = nullptr);
|
|
|
|
-
|
|
|
|
std::shared_ptr<Spell> createSpell(QString spell_name);
|
|
std::shared_ptr<Spell> createSpell(QString spell_name);
|
|
-
|
|
|
|
- const std::vector<QString> &getAvailableUnitsList();
|
|
|
|
- const std::vector<std::shared_ptr<Unit>> &getAllUnitsList();
|
|
|
|
-
|
|
|
|
|
|
+ std::shared_ptr<Effect> createEffect(QString effect_name);
|
|
|
|
+ static SpellManager& getInstance(){
|
|
|
|
+ static SpellManager instance;
|
|
|
|
+ return instance;
|
|
|
|
+ }
|
|
private:
|
|
private:
|
|
- QString race_id_;
|
|
|
|
- QString race_name_;
|
|
|
|
- QImage race_icon_;
|
|
|
|
- QString race_descr_;
|
|
|
|
- ObjectFactory<Unit, QString> spells_factory_;
|
|
|
|
|
|
+ SpellManager();
|
|
|
|
+ SpellManager(const SpellManager&) = delete;
|
|
|
|
+ SpellManager &operator=(SpellManager&) = delete;
|
|
|
|
+ ObjectFactory<Spell, QString> spells_factory_;
|
|
|
|
+ ObjectFactory<Effect, QString> effects_factory_;
|
|
std::vector<QString> available_spells_list_;
|
|
std::vector<QString> available_spells_list_;
|
|
std::vector<std::shared_ptr<Unit>> all_spells_list_;
|
|
std::vector<std::shared_ptr<Unit>> all_spells_list_;
|
|
-}*/
|
|
|
|
|
|
+};
|
|
#endif // SPELLSMANAGER_H
|
|
#endif // SPELLSMANAGER_H
|