QuestInfo.h 960 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * QuestInfo.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 "int3.h"
  12. #include "../constants/EntityIdentifiers.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. class CQuest;
  15. class CGObjectInstance;
  16. class IGameInfoCallback;
  17. struct DLL_LINKAGE QuestInfo //universal interface for human and AI
  18. {
  19. ObjectInstanceID obj; //related object, Seer Hut or Border Guard
  20. QuestInfo() = default;
  21. explicit QuestInfo(ObjectInstanceID Obj)
  22. : obj(Obj)
  23. {}
  24. const CQuest * getQuest(IGameInfoCallback *cb) const;
  25. const CGObjectInstance * getObject(IGameInfoCallback *cb) const;
  26. int3 getPosition(IGameInfoCallback *cb) const;
  27. bool operator== (const QuestInfo & qi) const
  28. {
  29. return obj == qi.obj;
  30. }
  31. template <typename Handler> void serialize(Handler &h)
  32. {
  33. h & obj;
  34. }
  35. };
  36. VCMI_LIB_NAMESPACE_END