OpenTTD Source  12.0-beta2
subsidy_func.h File Reference
#include "core/geometry_type.hpp"
#include "station_type.h"
#include "company_type.h"
#include "cargo_type.h"
#include "news_type.h"
#include "subsidy_base.h"

Go to the source code of this file.

Functions

std::pair< NewsReferenceType, NewsReferenceTypeSetupSubsidyDecodeParam (const struct Subsidy *s, SubsidyDecodeParamType mode, uint parameter_offset=0)
 
void DeleteSubsidyWith (SourceType type, SourceID index)
 Delete the subsidies associated with a given cargo source type and id. More...
 
bool CheckSubsidised (CargoID cargo_type, CompanyID company, SourceType src_type, SourceID src, const Station *st)
 Tests whether given delivery is subsidised and possibly awards the subsidy to delivering company. More...
 
void RebuildSubsidisedSourceAndDestinationCache ()
 Perform a full rebuild of the subsidies cache.
 

Detailed Description

Functions related to subsidies.

Definition in file subsidy_func.h.

Function Documentation

◆ CheckSubsidised()

◆ DeleteSubsidyWith()

void DeleteSubsidyWith ( SourceType  type,
SourceID  index 
)

Delete the subsidies associated with a given cargo source type and id.

Parameters
typeCargo source type of the id.
indexId to remove.

Definition at line 152 of file subsidy.cpp.

References InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_subsidy_pool >::Iterate(), RebuildSubsidisedSourceAndDestinationCache(), and WC_SUBSIDIES_LIST.

Referenced by Town::~Town().