conditionhasquest.cpp

来自「dk1游戏的原代码文件,完整.编译系统redhat7.3,mysql 3.23 」· C++ 代码 · 共 85 行

CPP
85
字号
////////////////////////////////////////////////////////////////////////////////// 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 + =
减小字号Ctrl + -
显示快捷键?