Created
October 14, 2011 21:18
-
-
Save jdoliner/1288379 to your computer and use it in GitHub Desktop.
json_spirit Object example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline | |
std::string GetVillageOwnerJson(Player p, const std::vector<std::string> &properties) | |
{ | |
json_spirit::Object root; | |
//std::vector< json_spirit::Pair > root; | |
BOOST_FOREACH(std::string f, properties) | |
{ | |
if(IsValidPlayerProperty(f)) | |
{ | |
root[f] = GetPlayerPropertyValue | |
//root.push_back(json_spirit::Pair(f, GetPlayerPropertyValue(p, f))); | |
} | |
} | |
return json_spirit::write(root); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment