OpenTTD Source 20250312-master-gcdcc6b491d
subsidy_func.h File Reference

Functions related to subsidies. More...

#include "station_type.h"
#include "company_type.h"
#include "cargo_type.h"

Go to the source code of this file.

Functions

void DeleteSubsidyWith (Source src)
 Delete the subsidies associated with a given cargo source type and id.
 
bool CheckSubsidised (CargoType cargo_type, CompanyID company, Source src, const Station *st)
 Tests whether given delivery is subsidised and possibly awards the subsidy to delivering company.
 
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()

bool CheckSubsidised ( CargoType  cargo_type,
CompanyID  company,
Source  src,
const Station st 
)

Tests whether given delivery is subsidised and possibly awards the subsidy to delivering company.

Parameters
cargo_typetype of cargo
companycompany delivering the cargo
srcsource of cargo
ststation where the cargo is delivered to
Returns
is the delivery subsidised?

Definition at line 507 of file subsidy.cpp.

References Town::cache, Station::catchment_tiles, Destination, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_town_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_industry_pool >::Get(), include(), Station::industries_near, Industry, INVALID_TILE, IsTileType(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_subsidy_pool >::Iterate(), MP_HOUSE, TownCache::part_of_subsidy, BaseStation::rect, Source, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Town, and Source::type.

Referenced by DeliverGoods().

◆ DeleteSubsidyWith()

void DeleteSubsidyWith ( Source  source)

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

Parameters
sourceThe source to look for.

Definition at line 119 of file subsidy.cpp.

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

Referenced by Town::~Town().

◆ RebuildSubsidisedSourceAndDestinationCache()

void RebuildSubsidisedSourceAndDestinationCache ( )