asIScriptModule == asIScriptModule

Started by
1 comment, last by ccvca 10 years, 2 months ago

Hi,

I want to compare if a asIScriptFunction* containes to a stored module.


//c++
asIScriptModule *myModule;


void setCallback(asIScriptFunction * func){
   //compare if func contains to the module myModule
   
   // bad way
   if(std::string(func->getModule()->getName()) == myModule->getName()){
      
   } 

   ///... do something else
}


//AngelScript

void callback(){
   //some code
}

void main(){
   setCallback(@callback);

}

Using the name of the module is possible, but it's not a fast solution.

Is there any 'ID' like the Index in "asIScriptEngine::GetModuleByIndex()" stored inside a module?

Thanks for every answer
ccvca

Advertisement

You can compare the asIScriptModule pointers directly. There is no need for an additional id.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

You can compare the asIScriptModule pointers directly. There is no need for an additional id.

Thank you. That's all I need to know.

This topic is closed to new replies.

Advertisement