• Advertisement
Sign in to follow this  

how use the enum of class by angelscript ?

This topic is 3653 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

Class A { enum _CODE { _CODE_NONE, _CODE_ONE } }; how can i register this by angelscript ? Thanks so much ! :)

Share this post


Link to post
Share on other sites
Advertisement
Currently you can only do this by declaring constants in the script, e.g.:


const char *scriptConstants =
"const int _CODE_NONE = 0; const int _CODE_ONE = 1;";
engine->AddScriptSection(module, "constants", scriptConstants, strlen(scriptConstants));

// Add the normal script section to the same module, then build it


However, as of the next release AngelScript will support true enums. Digital_Asphyxia already sent me the code that implements this support, I just have to include it in the library. Hopefully, by the end of the week, the WIP version in SVN will already have the support.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Thanks for reply :)

That's a good news for angelscript ~~ I hope we can use the real enum for the next version ~~ thanks for your work ~ I really like AS :)

Share this post


Link to post
Share on other sites
I added preliminary support for enum to the WIP version in SVN now. I'll be doing some more modifications to it, but I'd be grateful for any additional testing I can get before I release the next version.

Share this post


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

  • Advertisement