diff options
Diffstat (limited to 'src/news_func.h')
-rw-r--r-- | src/news_func.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/news_func.h b/src/news_func.h index 64edf636b..1f77d2970 100644 --- a/src/news_func.h +++ b/src/news_func.h @@ -8,8 +8,25 @@ #include "news_type.h" #include "vehicle_type.h" #include "station_type.h" +#include "industry_type.h" + +void AddNewsItem(StringID string, NewsSubtype subtype, NewsReferenceType reftype1 = NR_NONE, uint32 ref1 = UINT32_MAX, NewsReferenceType reftype2 = NR_NONE, uint32 ref2 = UINT32_MAX, void *free_data = NULL); + +static inline void AddCompanyNewsItem(StringID string, NewsSubtype subtype, CompanyNewsInformation *cni) +{ + AddNewsItem(string, subtype, NR_NONE, UINT32_MAX, NR_NONE, UINT32_MAX, cni); +} + +static inline void AddVehicleNewsItem(StringID string, NewsSubtype subtype, VehicleID vehicle, StationID station = INVALID_STATION) +{ + AddNewsItem(string, subtype, NR_VEHICLE, vehicle, station == INVALID_STATION ? NR_NONE : NR_STATION, station); +} + +static inline void AddIndustryNewsItem(StringID string, NewsSubtype subtype, IndustryID industry) +{ + AddNewsItem(string, subtype, NR_INDUSTRY, industry); +} -void AddNewsItem(StringID string, NewsSubtype subtype, uint data_a, uint data_b, void *free_data = NULL); void NewsLoop(); void InitNewsItemStructs(); @@ -23,9 +40,12 @@ extern NewsTypeData _news_type_data[]; * if the news item type is INVALID_STRING_ID all news about the vehicle get * deleted */ -void DeleteVehicleNews(VehicleID, StringID news); +void DeleteVehicleNews(VehicleID vid, StringID news); + +/** Delete news associated with given station */ +void DeleteStationNews(StationID sid); /** Delete news associated with given station */ -void DeleteStationNews(StationID); +void DeleteIndustryNews(IndustryID iid); #endif /* NEWS_FUNC_H */ |