I have this enum
enum CombatType_t
{
COMBAT_ICEDAMAGE = 1 << 9, // 512
COMBAT_HOLYDAMAGE = 1 << 10, // 1024
COMBAT_DEATHDAMAGE = 1 << 11, // 2048
};
Basically, im trying to make a new array/list to be able to index an string by using a specific number to index CombatType_t
Something as the following:
enum AbsorbType_t
{
"elementIce" = 512,
"elementHoly" = 1024,
"elementDeath" = 2048
}
In Lua, for example I could make an associative table
local t = {
[512] = "elementIce";
}
And then, to index i could simply do t[512] which returns "elementIce"
How can I do this in C++?