Clone.h 780 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Clone.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. namespace spells
  14. {
  15. namespace effects
  16. {
  17. class Clone : public UnitEffect
  18. {
  19. public:
  20. void apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const override;
  21. protected:
  22. bool isReceptive(const Mechanics * m, const battle::Unit * s) const override;
  23. bool isValidTarget(const Mechanics * m, const battle::Unit * s) const override;
  24. void serializeJsonUnitEffect(JsonSerializeFormat & handler) override final;
  25. private:
  26. int maxTier = 0;
  27. };
  28. }
  29. }
  30. VCMI_LIB_NAMESPACE_END