Hi all!
Is there any way to typecast an Enum to a raw integer in angelScript? I've tried using C's typecast syntax and the cast operator. neither worked :/. Some more suggestions?
thanks
~Bollu
Posted 22 February 2013 - 08:01 AM
Hi all!
Is there any way to typecast an Enum to a raw integer in angelScript? I've tried using C's typecast syntax and the cast operator. neither worked :/. Some more suggestions?
thanks
~Bollu
a WIP 2d game engine: https://code.google.com/p/modulusengine/
English is not my first language, so do feel free to correct me ![]()
Posted 22 February 2013 - 02:07 PM
The enums are implicitly converted to integers by the compiler, but if you want to explicitly do the conversion you may use the C++ style cast (not C style).
enum E { VALUE = 1 }
int a = int(VALUE);