示例#1
0
bool CCommandSystem::ProcessCommand ( const char *szCommand, const char *szParams )
{
	CCommand * pCommand = NULL;
	std::list<CCommand *>::iterator iter;
	for ( iter = m_Commands.begin(); iter != m_Commands.end(); iter ++ )
	{
		if ( !_stricmp( (*iter)->m_szCommand , const_cast<char *>(szCommand) ) )
		{
			pCommand = (*iter);
			if(pCommand)
			{
				pCommand->m_Function(const_cast<char *>(szParams));	
				return true;
			}
		}
	}
	return false;
}