amuse
1
I tried
ccocos2d::ValueMap m=FileUtils::getInstance()->getValueMapFromFile("xxx.plist")
for(cocos2d::ValueMap vm in m){
}
but seems unable to compile, can anyone have example to iterate?
also, is there any method to get all keys in ccocos2d::ValueMap?
You can use standard C++ iterators:
for (auto it = m.begin(); it != m.end(); ++it) {
const std::string &name = it->first;
ValueMap &innerDict = it->second.asValueMap();
The value of it->second might not be the same type as ValueMap, but this should answer your question.