DefendTown.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * ArmyUpgrade.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 "../Goals/CGoal.h"
  12. #include "../Pathfinding/AINodeStorage.h"
  13. #include "../Analyzers/ArmyManager.h"
  14. #include "../Analyzers/DangerHitMapAnalyzer.h"
  15. namespace NKAI
  16. {
  17. namespace Goals
  18. {
  19. class DLL_EXPORT DefendTown : public CGoal<DefendTown>
  20. {
  21. private:
  22. uint64_t defenceArmyStrength;
  23. HitMapInfo treat;
  24. uint8_t turn;
  25. bool counterattack;
  26. public:
  27. DefendTown(const CGTownInstance * town, const HitMapInfo & treat, const AIPath & defencePath, bool isCounterAttack = false);
  28. DefendTown(const CGTownInstance * town, const HitMapInfo & treat, const CGHeroInstance * defender);
  29. bool operator==(const DefendTown & other) const override;
  30. std::string toString() const override;
  31. const HitMapInfo & getTreat() const { return treat; }
  32. uint64_t getDefenceStrength() const { return defenceArmyStrength; }
  33. uint8_t getTurn() const { return turn; }
  34. bool isCounterAttack() { return counterattack; }
  35. };
  36. }
  37. }