mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-07 07:04:36 +01:00
Add const version of NewsItemQueue::operator[]
This commit is contained in:
@@ -75,6 +75,11 @@ NewsItem* news_item_get(int32_t index)
|
||||
}
|
||||
|
||||
NewsItem& NewsItemQueue::operator[](size_t index)
|
||||
{
|
||||
return const_cast<NewsItem&>(const_cast<const NewsItemQueue&>(*this)[index]);
|
||||
}
|
||||
|
||||
const NewsItem& NewsItemQueue::operator[](size_t index) const
|
||||
{
|
||||
if (index < NEWS_ITEM_HISTORY_START)
|
||||
return Recent[index];
|
||||
|
||||
@@ -68,6 +68,7 @@ extern const uint8_t news_type_properties[10];
|
||||
struct NewsItemQueue
|
||||
{
|
||||
NewsItem& operator[](size_t index);
|
||||
const NewsItem& operator[](size_t index) const;
|
||||
NewsItem* At(int32_t index);
|
||||
const NewsItem* At(int32_t index) const;
|
||||
bool IsEmpty() const;
|
||||
|
||||
Reference in New Issue
Block a user