📄 conditionhasquest.cpp
字号:
////////////////////////////////////////////////////////////////////////////////// Filename : ConditionHasQuest.cpp// Written By : // Description :////////////////////////////////////////////////////////////////////////////////#include "ConditionHasQuest.h"#include "PlayerCreature.h"#include "mission/QuestManager.h"////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ConditionHasQuest::ConditionHasQuest() throw(){ __BEGIN_TRY __END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ConditionHasQuest::~ConditionHasQuest() throw(){ __BEGIN_TRY __END_CATCH}////////////////////////////////////////////////////////////////////////////////// is satisfied?////////////////////////////////////////////////////////////////////////////////bool ConditionHasQuest::isSatisfied (Creature * pCreature1 , Creature * pCreature2, void* pParam) const throw () { Assert(pCreature2 != NULL); Assert(pCreature2->isPC()); PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature2); Assert( pPC != NULL ); //cout << "isSatisfied? " << toString() << " ... " << pPC->getName() << endl; QuestManager* pQM = pPC->getQuestManager(); if ( pQM == NULL || !pQM->hasQuest() ) return false; if ( pQM->getQuestStatus( m_QuestID ) == NULL ) return false; //cout << "Satisfied" << endl; return true;}//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void ConditionHasQuest::read (PropertyBuffer & propertyBuffer) throw (Error){ try { m_QuestID = propertyBuffer.getPropertyInt("QuestID"); } catch (NoSuchElementException & nsee) { throw Error(nsee.toString()); }}////////////////////////////////////////////////////////////////////////////////// get debug string////////////////////////////////////////////////////////////////////////////////string ConditionHasQuest::toString () const throw () { __BEGIN_TRY StringStream msg; msg << "ConditionHasQuest(" << "QuestID : " << m_QuestID << ")"; return msg.toString(); __END_CATCH}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -