Get std::string explicitly from json
parent
cde7642711
commit
e331bce0d6
|
@ -44,7 +44,7 @@ Body::Body(const Json &jsonObj, Space *space) :
|
|||
|
||||
Properties().LoadFromJson(bodyObj);
|
||||
m_frame = bodyObj["index_for_frame"];
|
||||
m_label = bodyObj["label"];
|
||||
m_label = bodyObj["label"].get<std::string>();
|
||||
Properties().Set("label", m_label);
|
||||
m_dead = bodyObj["dead"];
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ FrameId Frame::FromJson(const Json &frameObj, Space *space, FrameId parent, doub
|
|||
|
||||
f->m_flags = frameObj["flags"];
|
||||
f->m_radius = frameObj["radius"];
|
||||
f->m_label = frameObj["label"];
|
||||
f->m_label = frameObj["label"].get<std::string>();
|
||||
|
||||
f->m_pos = frameObj["pos"];
|
||||
f->m_angSpeed = frameObj["ang_speed"];
|
||||
|
|
|
@ -188,7 +188,7 @@ Ship::Ship(const Json &jsonObj, Space *space) :
|
|||
|
||||
m_navLights->LoadFromJson(shipObj);
|
||||
|
||||
m_shipName = shipObj["name"];
|
||||
m_shipName = shipObj["name"].get<std::string>();
|
||||
Properties().Set("shipName", m_shipName);
|
||||
} catch (Json::type_error &) {
|
||||
throw SavedGameCorruptException();
|
||||
|
|
|
@ -111,10 +111,10 @@ namespace SceneGraph {
|
|||
if (decalsArray.size() != MAX_DECAL_MATERIALS) throw SavedGameCorruptException();
|
||||
for (unsigned int i = 0; i < MAX_DECAL_MATERIALS; i++) {
|
||||
Json arrayElem = decalsArray[i];
|
||||
m_decals[i] = arrayElem["decal"];
|
||||
m_decals[i] = arrayElem["decal"].get<std::string>();
|
||||
}
|
||||
|
||||
m_label = modelSkinObj["label"];
|
||||
m_label = modelSkinObj["label"].get<std::string>();
|
||||
} catch (Json::type_error &) {
|
||||
throw SavedGameCorruptException();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue