OpenTTD Source  20241121-master-g67a0fccfad
station_base.h File Reference

Base classes/functions for stations. More...

#include "core/random_func.hpp"
#include "base_station_base.h"
#include "newgrf_airport.h"
#include "cargopacket.h"
#include "industry_type.h"
#include "linkgraph/linkgraph_type.h"
#include "newgrf_storage.h"
#include "bitmap_type.h"

Go to the source code of this file.

Data Structures

class  FlowStat
 Flow statistics telling how much flow should be sent along a link. More...
 
class  FlowStatMap
 Flow descriptions by origin stations. More...
 
struct  GoodsEntry
 Stores station stats for a single cargo. More...
 
struct  Airport
 All airport-related information. More...
 
struct  IndustryListEntry
 
struct  IndustryCompare
 
struct  Station
 Station data structure. More...
 
class  AirportTileIterator
 Iterator to iterate over all tiles belonging to an airport. More...
 

Typedefs

typedef std::set< IndustryListEntry, IndustryCompareIndustryList
 

Functions

void RebuildStationKdtree ()
 
template<typename Func >
void ForAllStationsAroundTiles (const TileArea &ta, Func func)
 Call a function on all stations that have any part of the requested area within their catchment. More...
 

Variables

static const uint8_t INITIAL_STATION_RATING = 175
 
static const uint8_t MAX_STATION_RATING = 255
 

Detailed Description

Base classes/functions for stations.

Definition in file station_base.h.

Function Documentation

◆ ForAllStationsAroundTiles()

template<typename Func >
void ForAllStationsAroundTiles ( const TileArea ta,
Func  func 
)

Call a function on all stations that have any part of the requested area within their catchment.

Template Parameters
FuncThe type of funcion to call
Parameters
areaThe TileArea to check
funcThe function to call, must take two parameters: Station* and TileIndex and return true if coverage of that tile is acceptable for a given station or false if search should continue

Definition at line 564 of file station_base.h.

References _settings_game, CA_UNMODIFIED, OrthogonalTileArea::Expand(), SpecializedStation< Station, false >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_station_pool >::GetNumItems(), GetStationIndex(), Station::industry, IsTileType(), MAX_CATCHMENT, StationSettings::modified_catchment, MP_STATION, StationSettings::serve_neutral_industries, and GameSettings::station.

Referenced by PopulateStationsNearby().