OpenTTD Source 20241224-master-gf74b0cf984
|
Stores station stats for a single cargo. More...
#include <station_base.h>
Public Types | |
enum | GoodsEntryStatus { GES_ACCEPTANCE , GES_RATING , GES_EVER_ACCEPTED , GES_LAST_MONTH , GES_CURRENT_MONTH , GES_ACCEPTED_BIGTICK } |
Status of this cargo for the station. More... | |
Public Member Functions | |
bool | HasVehicleEverTriedLoading () const |
Reports whether a vehicle has ever tried to load the cargo at this station. | |
bool | HasRating () const |
Does this cargo have a rating at this station? | |
StationID | GetVia (StationID source) const |
Get the best next hop for a cargo packet from station source. | |
StationID | GetVia (StationID source, StationID excluded, StationID excluded2=INVALID_STATION) const |
Get the best next hop for a cargo packet from station source, optionally excluding one or two stations. | |
Data Fields | |
StationCargoList | cargo {} |
The cargo packets of cargo waiting in this station. | |
FlowStatMap | flows {} |
Planned flows through this station. | |
uint | max_waiting_cargo = 0 |
Max cargo from this station waiting at any station. | |
NodeID | node = INVALID_NODE |
ID of node in link graph referring to this goods entry. | |
LinkGraphID | link_graph = INVALID_LINK_GRAPH |
Link graph this station belongs to. | |
uint8_t | status = 0 |
Status of this cargo, see GoodsEntryStatus. | |
uint8_t | time_since_pickup = 255 |
Number of rating-intervals (up to 255) since the last vehicle tried to load this cargo. | |
uint8_t | rating = INITIAL_STATION_RATING |
Station rating for this cargo. | |
uint8_t | last_speed = 0 |
Maximum speed (up to 255) of the last vehicle that tried to load this cargo. | |
uint8_t | last_age = 255 |
Age in years (up to 255) of the last vehicle that tried to load this cargo. | |
uint8_t | amount_fract = 0 |
Fractional part of the amount in the cargo list. | |
Stores station stats for a single cargo.
Definition at line 166 of file station_base.h.
Status of this cargo for the station.
Definition at line 168 of file station_base.h.
|
inline |
Get the best next hop for a cargo packet from station source.
source | Source of the packet. |
Definition at line 268 of file station_base.h.
References flows.
Referenced by StationCargoReroute::operator()(), and VehicleCargoReroute::operator()().
|
inline |
Get the best next hop for a cargo packet from station source, optionally excluding one or two stations.
source | Source of the packet. |
excluded | If this station would be chosen choose the second best one instead. |
excluded2 | Second station to be excluded, if != INVALID_STATION. |
Definition at line 282 of file station_base.h.
References flows.
|
inline |
Does this cargo have a rating at this station?
Definition at line 258 of file station_base.h.
References GES_RATING, and HasBit().
Referenced by CalcPercentVehicleFilled(), StationViewWindow::DrawCargoRatings(), CompanyStationsWindow::DrawWidget(), LoadUnloadVehicle(), CompanyStationsWindow::StationRatingMaxSorter(), and CompanyStationsWindow::StationRatingMinSorter().
|
inline |
Reports whether a vehicle has ever tried to load the cargo at this station.
This does not imply that there was cargo available for loading. Refer to GES_RATING for that.
Definition at line 252 of file station_base.h.
uint8_t GoodsEntry::amount_fract = 0 |
Fractional part of the amount in the cargo list.
Definition at line 245 of file station_base.h.
StationCargoList GoodsEntry::cargo {} |
The cargo packets of cargo waiting in this station.
Definition at line 210 of file station_base.h.
Referenced by StationViewWindow::BuildCargoList(), Vehicle::CancelReservation(), StationViewWindow::DrawEntries(), CompanyStationsWindow::DrawWidget(), HandleStationRefit(), LoadUnloadVehicle(), ReturnCargoAction::operator()(), FinalizeRefitAction::operator()(), PrepareUnload(), RerouteCargo(), StationResolverObject::ResolveReal(), StationResolverObject::StationResolverObject(), CompanyStationsWindow::StationWaitingAvailableSorter(), CompanyStationsWindow::StationWaitingTotalSorter(), SwapPackets(), and TruncateCargo().
FlowStatMap GoodsEntry::flows {} |
Planned flows through this station.
Definition at line 211 of file station_base.h.
Referenced by LinkGraphOverlay::AddLinks(), StationViewWindow::BuildCargoList(), DeleteStaleLinks(), StationViewWindow::EstimateDestinations(), GetVia(), GetVia(), StationViewWindow::RecalcDestinations(), VehicleCargoList::Stage(), LinkGraphJob::~LinkGraphJob(), and Station::~Station().
uint8_t GoodsEntry::last_age = 255 |
Age in years (up to 255) of the last vehicle that tried to load this cargo.
This does not imply there was any cargo to load.
Definition at line 243 of file station_base.h.
Referenced by LoadUnloadVehicle().
uint8_t GoodsEntry::last_speed = 0 |
Maximum speed (up to 255) of the last vehicle that tried to load this cargo.
This does not imply there was any cargo to load. The unit used is a special vehicle-specific speed unit for station ratings.
Definition at line 237 of file station_base.h.
Referenced by LoadUnloadVehicle().
LinkGraphID GoodsEntry::link_graph = INVALID_LINK_GRAPH |
Link graph this station belongs to.
Definition at line 215 of file station_base.h.
Referenced by LinkGraphOverlay::AddLinks(), DeleteStaleLinks(), StationViewWindow::DrawCargoRatings(), IncreaseStats(), LinkGraph::Merge(), LinkRefresher::RefreshStats(), UpdateStationAcceptance(), and LinkGraphJob::~LinkGraphJob().
uint GoodsEntry::max_waiting_cargo = 0 |
Max cargo from this station waiting at any station.
Definition at line 213 of file station_base.h.
Referenced by TruncateCargo().
NodeID GoodsEntry::node = INVALID_NODE |
ID of node in link graph referring to this goods entry.
Definition at line 214 of file station_base.h.
Referenced by LinkGraphOverlay::AddLinks(), DeleteStaleLinks(), StationViewWindow::DrawCargoRatings(), IncreaseStats(), LinkGraph::Merge(), LinkGraph::RemoveNode(), UpdateStationAcceptance(), and LinkGraphJob::~LinkGraphJob().
uint8_t GoodsEntry::rating = INITIAL_STATION_RATING |
Station rating for this cargo.
Definition at line 226 of file station_base.h.
Referenced by StationViewWindow::DrawCargoRatings(), CompanyStationsWindow::DrawWidget(), CompanyStationsWindow::StationRatingMaxSorter(), and CompanyStationsWindow::StationRatingMinSorter().
uint8_t GoodsEntry::status = 0 |
Status of this cargo, see GoodsEntryStatus.
Definition at line 217 of file station_base.h.
Referenced by LinkGraph::AddNode(), DeliverGoods(), LoadUnloadVehicle(), PrepareUnload(), TriggerWatchedCargoCallbacks(), and UpdateStationAcceptance().
uint8_t GoodsEntry::time_since_pickup = 255 |
Number of rating-intervals (up to 255) since the last vehicle tried to load this cargo.
The unit used is STATION_RATING_TICKS. This does not imply there was any cargo to load.
Definition at line 224 of file station_base.h.
Referenced by LoadUnloadVehicle().