Dispel.h 965 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Dispel.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "UnitEffect.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. struct Bonus;
  14. class CSelector;
  15. class BonusList;
  16. struct SetStackEffect;
  17. namespace spells
  18. {
  19. namespace effects
  20. {
  21. class Dispel : public UnitEffect
  22. {
  23. public:
  24. Dispel();
  25. virtual ~Dispel();
  26. void apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const override;
  27. protected:
  28. bool isValidTarget(const Mechanics * m, const battle::Unit * unit) const override;
  29. void serializeJsonUnitEffect(JsonSerializeFormat & handler) override final;
  30. private:
  31. bool positive = false;
  32. bool negative = false;
  33. bool neutral = false;
  34. std::shared_ptr<const BonusList> getBonuses(const Mechanics * m, const battle::Unit * unit) const;
  35. };
  36. }
  37. }
  38. VCMI_LIB_NAMESPACE_END