Advertisement Jump to content
Sign in to follow this  
ccvca

asIScriptModule == asIScriptModule

This topic is 1802 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Edited by ccvca

Share this post


Link to post
Share on other sites
Advertisement

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

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!