QuestInfo.cpp 808 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * QuestInfo.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 "QuestInfo.h"
  12. #include "../callback/IGameInfoCallback.h"
  13. #include "../mapObjects/CQuest.h"
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. const CQuest * QuestInfo::getQuest(IGameInfoCallback *cb) const
  16. {
  17. auto questObject = dynamic_cast<const IQuestObject*>(getObject(cb));
  18. assert(questObject);
  19. return &questObject->getQuest();
  20. }
  21. const CGObjectInstance * QuestInfo::getObject(IGameInfoCallback *cb) const
  22. {
  23. return cb->getObjInstance(obj);
  24. }
  25. int3 QuestInfo::getPosition(IGameInfoCallback *cb) const
  26. {
  27. return getObject(cb)->visitablePos();
  28. }
  29. VCMI_LIB_NAMESPACE_END