2
0

Moat.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Moat.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 "Obstacle.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. namespace spells
  14. {
  15. namespace effects
  16. {
  17. class Moat : public Obstacle
  18. {
  19. private:
  20. ObstacleSideOptions sideOptions; //Defender only
  21. std::vector<std::vector<BattleHex>> moatHexes; //Determine number of moat patches and hexes
  22. std::vector<std::shared_ptr<Bonus>> bonus; //For battle-wide bonuses
  23. bool dispellable; //For Tower landmines
  24. int moatDamage; // Minimal moat damage
  25. public:
  26. void apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const override;
  27. protected:
  28. void serializeJsonEffect(JsonSerializeFormat & handler) override;
  29. void placeObstacles(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const override;
  30. void convertBonus(const Mechanics * m, std::vector<Bonus> & converted) const;
  31. };
  32. }
  33. }
  34. VCMI_LIB_NAMESPACE_END