SaveResources.cpp 773 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * SaveResources.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 "SaveResources.h"
  12. #include "../AIGateway.h"
  13. #include "../Behaviors/CaptureObjectsBehavior.h"
  14. namespace NK2AI
  15. {
  16. using namespace Goals;
  17. bool SaveResources::operator==(const SaveResources & other) const
  18. {
  19. return true;
  20. }
  21. void SaveResources::accept(AIGateway * aiGw)
  22. {
  23. aiGw->nullkiller->lockResources(resources);
  24. logAi->debug("Locked resources %s", resources.toString());
  25. throw goalFulfilledException(sptr(*this));
  26. }
  27. std::string SaveResources::toString() const
  28. {
  29. return "SaveResources " + resources.toString();
  30. }
  31. }