spellsmanager.cpp 983 B

12345678910111213141516171819202122232425262728
  1. #include <spellsmanager.h>
  2. #include <spells/meleedamagespell.h>
  3. #include <spells/selfhealspell.h>
  4. #include <spells/selfmovespell.h>
  5. #include <effects/effect.h>
  6. #include <effects/meleedamage.h>
  7. #include <effects/selfheal.h>
  8. #include <effects/selfmove.h>
  9. SpellManager::SpellManager(){
  10. spells_factory_.addClass<MeleeDamageSpell, QString>("MeleeDamageSpell");
  11. spells_factory_.addClass<SelfHealSpell, QString>("SelfHealSpell");
  12. spells_factory_.addClass<SelfMoveSpell, QString>("SelfMoveSpell");
  13. effects_factory_.addClass<SelfMove, QString>("SelfMove");
  14. //effects_factory_.addClass<MeleeDamage, QString>("MeleeDamage");
  15. //effects_factory_.addClass<SelfHeal, QString>("SelfHeal");
  16. }
  17. std::shared_ptr<Spell> SpellManager::createSpell(QString spell_name){
  18. return spells_factory_.createObject(spell_name, QString());
  19. }
  20. std::shared_ptr<Effect> SpellManager::createEffect(QString effect_name){
  21. return effects_factory_.createObject(effect_name, QString());
  22. }