#include "StdAfx.h" #include "DnChangeActionStrProcessor.h" #include "DnActor.h" #include "DnProjectile.h" #ifdef _DEBUG #define new new(_NORMAL_BLOCK,__FILE__,__LINE__) #endif CDnChangeActionStrProcessor::CDnChangeActionStrProcessor( DnActorHandle hActor, const char *szAdditionalStr, DNVector(std::string) &szActionStr) : IDnSkillProcessor( hActor ) { m_iType = CHANGE_ACTIONSTR; // m_szAdditionalStr = szAdditionalStr; char szStr[64]; for( DWORD i=0; i::iterator it = m_szMapMatchStr.find( strNowActionName ); if( it == m_szMapMatchStr.end() ) { if( pBChanged ) *pBChanged = false; //return strNowActionName.c_str(); return NULL; } if( pBChanged ) *pBChanged = true; return it->second.c_str(); } bool CDnChangeActionStrProcessor::IsChangedActionName( const char* pActionName ) { if( m_setChangeActionNames.end() != m_setChangeActionNames.find( pActionName ) ) return true; else return false; } void CDnChangeActionStrProcessor::CopyFrom( IDnSkillProcessor* pProcessor ) { if( NULL == pProcessor ) return; if( GetType() != pProcessor->GetType() ) return; CDnChangeActionStrProcessor* pSource = static_cast( pProcessor ); map& matchList = pSource->GetMachStringList(); set& chageActionList = pSource->GetChangeActionNameList(); m_szMapMatchStr.clear(); m_setChangeActionNames.clear(); { map::iterator iter = matchList.begin(); map::iterator endIter = matchList.end(); for (; iter != endIter; ++iter) { m_szMapMatchStr.insert(std::make_pair(iter->first, iter->second)); } } { set::iterator iter = chageActionList.begin(); set::iterator endIter = chageActionList.end(); for (; iter != endIter; ++iter) { m_setChangeActionNames.insert((*iter)); } } }