| 1831 | } |
| 1832 | |
| 1833 | bool StockpileSettingsSerializer::write_furniture(color_ostream& out, StockpileSettings::FurnitureSet* furniture) { |
| 1834 | using df::enums::furniture_type::furniture_type; |
| 1835 | |
| 1836 | auto & pfurniture = mSettings->furniture; |
| 1837 | bool all = true; |
| 1838 | |
| 1839 | for (size_t i = 0; i < pfurniture.type.size(); ++i) { |
| 1840 | if (!pfurniture.type.at(i)) { |
| 1841 | all = false; |
| 1842 | continue; |
| 1843 | } |
| 1844 | string f_type{ENUM_KEY_STR(furniture_type, furniture_type(i))}; |
| 1845 | furniture->add_type(f_type); |
| 1846 | DEBUG(log, out).print("furniture_type {} is {}\n", i, f_type); |
| 1847 | } |
| 1848 | |
| 1849 | all = serialize_list_material(out, |
| 1850 | furniture_mat_is_allowed, |
| 1851 | [&](const string& token) { furniture->add_mats(token); }, |
| 1852 | pfurniture.mats) && all; |
| 1853 | all = serialize_list_other_mats(out, |
| 1854 | mOtherMatsFurniture.mats, |
| 1855 | [&](const string& token) { furniture->add_other_mats(token); }, |
| 1856 | pfurniture.other_mats) && all; |
| 1857 | all = serialize_list_quality(out, |
| 1858 | [&](const string& token) { furniture->add_quality_core(token); }, |
| 1859 | pfurniture.quality_core) && all; |
| 1860 | all = serialize_list_quality(out, |
| 1861 | [&](const string& token) { furniture->add_quality_total(token); }, |
| 1862 | pfurniture.quality_total) && all; |
| 1863 | |
| 1864 | return all; |
| 1865 | } |
| 1866 | |
| 1867 | void StockpileSettingsSerializer::read_furniture(color_ostream& out, DeserializeMode mode, const vector<string>& filters) { |
| 1868 | auto & pfurniture = mSettings->furniture; |
nothing calls this directly
no test coverage detected