void VehiclePlacement::load(JsonObject &jo) { VehiclePlacement &placement = vplacements[vplacement_id(jo.get_string("id"))]; JsonArray locations = jo.get_array("locations"); while (locations.has_more()) { JsonObject jloc = locations.next_object(); placement.add(jmapgen_int(jloc, "x"), jmapgen_int(jloc, "y"), VehicleFacings(jloc, "facing")); } }
void VehicleFactory::load_vehicle_placement(JsonObject &jo) { const std::string placement_id = jo.get_string("id"); VehiclePlacement &placement = placements[placement_id]; JsonArray locations = jo.get_array("locations"); while (locations.has_more()) { JsonObject jloc = locations.next_object(); placement.add(jmapgen_int(jloc, "x"), jmapgen_int(jloc, "y"), VehicleFacings(jloc, "facing")); } }