CaptureObject.cpp 895 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * CaptureObject.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 "CaptureObject.h"
  12. #include "../../../lib/mapObjects/CGTownInstance.h"
  13. #include "../VCAI.h"
  14. #include "../Engine/Nullkiller.h"
  15. #include "../Behaviors/CaptureObjectsBehavior.h"
  16. extern boost::thread_specific_ptr<CCallback> cb;
  17. using namespace Goals;
  18. bool CaptureObject::operator==(const CaptureObject & other) const
  19. {
  20. return objid == other.objid;
  21. }
  22. uint64_t CaptureObject::getHash() const
  23. {
  24. return objid;
  25. }
  26. std::string CaptureObject::toString() const
  27. {
  28. return "Capture " + name + " at " + tile.toString();
  29. }
  30. TGoalVec CaptureObject::decompose() const
  31. {
  32. return CaptureObjectsBehavior(cb->getObj(ObjectInstanceID(objid))).decompose();
  33. }