Пример #1
0
// --[  Method  ]---------------------------------------------------------------
//
//  - Class     : CEffect
//  - prototype : bool DefineVar(const std::string& strName, const std::string& strClassName, const std::string& strDescription)
//
//  - Purpose   : Defines a new variable for the effect.
//                strName        : Variable name.
//                strClassName   : Effect class name. This will be used to find the proper plugin.
//                strDescription : Optional description. Mainly for future editors.
//
// -----------------------------------------------------------------------------
bool CEffect::DefineVar(const std::string& strName, const std::string& strClassName, const std::string& strDescription)
{
	CVar* pNewVar = (CVar*)CPluginManager::Instance().GetNewPlugin(CVar::GETCLASSTYPE(), strClassName);

	if(!pNewVar)
	{
		return false;
	}

	pNewVar->SetVarName(strName);
	pNewVar->SetVarDescription(strDescription);
	m_mapVars.insert(MAPVARS::value_type(strName, pNewVar));
	return true;
}