BattleAction.cpp 760 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * BattleAction.cpp, 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. #include "StdInc.h"
  11. #include "BattleAction.h"
  12. #include "../../AIGateway.h"
  13. #include "../../Goals/CompleteQuest.h"
  14. #include "../../../../lib/mapping/CMap.h" //for victory conditions
  15. namespace NKAI
  16. {
  17. extern boost::thread_specific_ptr<CCallback> cb;
  18. extern boost::thread_specific_ptr<AIGateway> ai;
  19. namespace AIPathfinding
  20. {
  21. void BattleAction::execute(const CGHeroInstance * hero) const
  22. {
  23. ai->moveHeroToTile(targetTile, hero);
  24. }
  25. std::string BattleAction::toString() const
  26. {
  27. return "Battle at " + targetTile.toString();
  28. }
  29. }
  30. }