* Writes up to 32 recent news messages to the buffer, with the most recent first. * @param output_iterator Iterator to write the output to. */
| 53 | * @param output_iterator Iterator to write the output to. |
| 54 | */ |
| 55 | static void SurveyRecentNews(nlohmann::json &json) |
| 56 | { |
| 57 | json = nlohmann::json::array(); |
| 58 | |
| 59 | int i = 0; |
| 60 | for (const auto &news : GetNews()) { |
| 61 | TimerGameCalendar::YearMonthDay ymd = TimerGameCalendar::ConvertDateToYMD(news.date); |
| 62 | json.push_back(fmt::format("({}-{:02}-{:02}) String: {}, Type: {}, Ref1: {}, {}, Ref2: {}, {}", |
| 63 | ymd.year, ymd.month + 1, ymd.day, news.GetStatusText(), news.type, |
| 64 | news.ref1.index(), SerialiseNewsReference(news.ref1), |
| 65 | news.ref2.index(), SerialiseNewsReference(news.ref2))); |
| 66 | if (++i > 32) break; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Create a timestamped filename. |
no test coverage detected