Public Types | Public Member Functions | Data Fields

GoodsEntry Struct Reference

Stores station stats for a single cargo. More...

#include <station_base.h>

Public Types

enum  GoodsEntryStatus {
  GES_ACCEPTANCE, GES_PICKUP, GES_EVER_ACCEPTED, GES_LAST_MONTH,
  GES_CURRENT_MONTH, GES_ACCEPTED_BIGTICK
}
 

Status of this cargo for the station.

More...

Public Member Functions

FlowStat GetSumFlowVia (StationID via) const
 Get the sum of flows via a specific station from this GoodsEntry.
void UpdateFlowStats (StationID source, uint count, StationID next)
 Update the flow stats for "count" cargo from "source" sent to "next".
void UpdateFlowStats (FlowStatSet &flow_stats, uint count, StationID next)
 Update the flow stats for a specific next station.
void UpdateFlowStats (FlowStatSet &flow_stats, FlowStatSet::iterator flow_it, uint count)
 Update the flow stats for a specific entry.
StationID UpdateFlowStatsTransfer (StationID source, uint count, StationID curr)
 Update the flow stats for "count" cargo that cannot be delivered here.

Data Fields

byte acceptance_pickup
 Status of this cargo, see GoodsEntryStatus.
byte days_since_pickup
 Number of days since the last pickup for this cargo (up to 255).
byte rating
 Station rating for this cargo.
byte last_speed
 Maximum speed of the last vehicle that picked up this cargo (up to 255).
byte last_age
 Age in years of the last vehicle that picked up this cargo.
byte amount_fract
 Fractional part of the amount in the cargo list.
StationCargoList cargo
 The cargo packets of cargo waiting in this station.
uint supply
 Cargo supplied last month.
uint supply_new
 Cargo supplied so far this month.
FlowStatMap flows
 Planned flows through this station.
LinkStatMap link_stats
 Capacities and usage statistics for outgoing links.
LinkGraphComponentID last_component
 Component this station was last part of in this cargo's link graph.
uint max_waiting_cargo
 Max cargo from this station waiting at any station.

Detailed Description

Stores station stats for a single cargo.

Definition at line 303 of file station_base.h.


Member Enumeration Documentation

Status of this cargo for the station.

Enumerator:
GES_ACCEPTANCE 

This cargo is currently being accepted by the station.

GES_PICKUP 

This cargo has been picked up at this station at least once.

GES_EVER_ACCEPTED 

The cargo has been accepted at least once.

GES_LAST_MONTH 

The cargo was accepted last month.

GES_CURRENT_MONTH 

The cargo was accepted this month.

GES_ACCEPTED_BIGTICK 

The cargo has been accepted since the last periodic processing.

Definition at line 305 of file station_base.h.


Member Function Documentation

FlowStat GoodsEntry::GetSumFlowVia ( StationID  via  )  const

Get the sum of flows via a specific station from this GoodsEntry.

Parameters:
via Remote station to look for.
Returns:
a FlowStat with all flows for 'via' added up.

Definition at line 4050 of file station_cmd.cpp.

References flows, and FlowStat::Via().

void GoodsEntry::UpdateFlowStats ( StationID  source,
uint  count,
StationID  next 
)

Update the flow stats for "count" cargo from "source" sent to "next".

Parameters:
source ID of station the cargo is from.
count Amount of cargo.
next ID of the station the cargo is travelling to.

Definition at line 4014 of file station_cmd.cpp.

References flows.

Referenced by PrepareUnload(), StationCargoList::TakeFrom(), UpdateFlowStats(), and UpdateFlowStatsTransfer().

void GoodsEntry::UpdateFlowStats ( FlowStatSet flow_stats,
FlowStatSet::iterator  flow_it,
uint  count 
)

Update the flow stats for a specific entry.

Parameters:
flow_stats Flow stats to update.
flow_it Iterator pointing to an entry in flow_stats.
count Amount by which the flow should be increased.

Definition at line 3980 of file station_cmd.cpp.

References FlowStat::Increase().

void GoodsEntry::UpdateFlowStats ( FlowStatSet flow_stats,
uint  count,
StationID  next 
)

Update the flow stats for a specific next station.

Parameters:
flow_stats Flow stats to update.
count Amount by which the flow should be increased.
next Next hop for which the flow stats should be updated.

Definition at line 3994 of file station_cmd.cpp.

References UpdateFlowStats().

StationID GoodsEntry::UpdateFlowStatsTransfer ( StationID  source,
uint  count,
StationID  curr 
)

Update the flow stats for "count" cargo that cannot be delivered here.

Parameters:
source ID of station where the cargo is from.
count Amount of cargo.
curr ID of station where it is stored for now.
Returns:
ID of the station where the cargo is sent next.

Definition at line 4028 of file station_cmd.cpp.

References flows, and UpdateFlowStats().

Referenced by StationCargoList::RerouteStalePackets().


The documentation for this struct was generated from the following files: