Jump to content
  • Advertisement
Sign in to follow this  
dkrusu

No type id for enum values?

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

I'm writing a function that takes a var arg type and then identifies the type to print either the value or information about the object. Everything seems to have an Id except enum values, however they always seem to get an id of 14. Can enum values be given a typeId like the rest? Or am I missing something that allows me to identify enum values?

 

Thanks,

Dave Krusu

Share this post


Link to post
Share on other sites
Advertisement
Each enum type will get their own type id.

You can identify a type id as being an enum like this:
bool isEnumType = false;
if( typeId > asTYPEID_DOUBLE && (typeId & asTYPEID_MASK_OBJECT) == 0 ) )
  isEnumType = true;


You may want to take a look at the debugger add-on. Especially the method 'string CDebugger::ToString(void *value, asUINT typeId, bool expandMembers, asIScriptEngine *engine)'. It shows how to identify different types and creating a human readable string about the value/type. Edited by Andreas Jonsson

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!