Codechange: Use std::list for News Items. (#12338)

This commit is contained in:
Peter Nelson
2024-04-04 07:53:14 +01:00
committed by GitHub
parent 08cf106fc6
commit f6a88e40a4
6 changed files with 155 additions and 196 deletions

View File

@@ -126,8 +126,6 @@ struct NewsAllocatedData {
/** Information about a single item of news. */
struct NewsItem {
NewsItem *prev; ///< Previous news item
NewsItem *next; ///< Next news item
StringID string_id; ///< Message text
TimerGameCalendar::Date date; ///< Calendar date to show for the news
TimerGameEconomy::Date economy_date; ///< Economy date of the news item, never shown but used to calculate age
@@ -169,4 +167,7 @@ struct CompanyNewsInformation : NewsAllocatedData {
CompanyNewsInformation(const struct Company *c, const struct Company *other = nullptr);
};
using NewsContainer = std::list<NewsItem>; ///< Container type for storing news items.
using NewsIterator = NewsContainer::const_iterator; ///< Iterator type for news items.
#endif /* NEWS_TYPE_H */