L4D15 / OpenGE

Open Game Engine
2 stars 0 forks source link

Change default values for components #14

Open L4D15 opened 10 years ago

L4D15 commented 10 years ago

There is a built-in method in json_spirit to deliver default values when a parameter is missing in the JSON. Change the horrible if (jsonString.contains(...)) statements for proper json_spirit default values.

std::string name = jsonString.getString("name", "I have no name");