Advertisement

Enumerate names of Enum

Started by October 24, 2013 07:56 PM
1 comment, last by Jason Goepel 11 years, 1 month ago

How does one enumerate the names of all globally registered Enums?


for (asUINT i = 0, n = p_engine->GetEnumCount(); i < n; ++i)
{
    int enumTypeId;
    p_engine->GetEnumByIndex(i, &enumTypeId);
    // Get Name ??
}

The name of the enum type is returned by GetEnumByIndex. Alternatively it can be obtained with GetTypeDeclaration. The name/value of each enum in the enum type is obtained with GetEnumValueByIndex.

I've documented this here: Manual: Reflection

Regards,

Andreas

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

Advertisement

Silly me. For some reason I was completely ignoring the return value. Thanks for answering my silly question.

This topic is closed to new replies.

Advertisement