I have config file that I include in all my files there I have different enums but inside each enum there are same element names for example: config.h
enum GameObjectType
{
NINJA_PLAYER
};
enum GameObjectTypeLocation
{
NONE,
MASSAGE_ALL, //this is for ComponentMadiator
NINJA_PLAYER
};
But when I try to compile the project with calling the enums with the proper enum name
m_pNinjaPlayer = (NinjaPlayer*)GameFactory::Instance().getGameObj(GameObjectType::NINJA_PLAYER);
ComponentMadiator::Instance().Register(GameObjectTypeLocation::NINJA_PLAYER,m_pNinjaPlayer);
I am getting compilation error:
error C2365: 'NINJA_PLAYER' : redefinition; previous definition was 'enumerator' (..\Classes\GameFactory.cpp)
2> d:\dev\cpp\2d\cocos2d-x-3.0\cocos2d-x-3.0\projects\lettersfun\classes\config.h(22) : see declaration of 'NINJA_PLAYER'
How can I keep in the config.h several enums with different names BUT with same elements names ?