DigAtTile.cpp 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * DigAtTile.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 "DigAtTile.h"
  12. #include "../AIGateway.h"
  13. #include "../AIUtility.h"
  14. namespace NKAI
  15. {
  16. extern boost::thread_specific_ptr<CCallback> cb;
  17. extern boost::thread_specific_ptr<AIGateway> ai;
  18. using namespace Goals;
  19. bool DigAtTile::operator==(const DigAtTile & other) const
  20. {
  21. return other.hero.h == hero.h && other.tile == tile;
  22. }
  23. //
  24. //TSubgoal DigAtTile::decomposeSingle() const
  25. //{
  26. // const CGObjectInstance * firstObj = vstd::frontOrNull(cb->getVisitableObjs(tile));
  27. // if(firstObj && firstObj->ID == Obj::HERO && firstObj->tempOwner == ai->playerID) //we have hero at dest
  28. // {
  29. // const CGHeroInstance * h = dynamic_cast<const CGHeroInstance *>(firstObj);
  30. // sethero(h).setisElementar(true);
  31. // return sptr(*this);
  32. // }
  33. //
  34. // return sptr(VisitTile(tile));
  35. //}
  36. }