Merge PR https://github.com/cocos2d/cocos2d-x/pull/3270, move enum into class and using enum class