Holds information about a route service between two stations. More...
#include <cargodest_base.h>
Public Member Functions | |
RouteLink (StationID dest=INVALID_STATION, OrderID prev_order=INVALID_ORDER, OrderID next_order=INVALID_ORDER, Owner owner=INVALID_OWNER, uint32 travel_time=0, VehicleType vtype=VEH_INVALID) | |
Constructor. | |
~RouteLink () | |
Invalidate some stuff on destruction. | |
StationID | GetDestination () const |
Get the target station of this link. | |
OrderID | GetOriginOrderId () const |
Get the order id that lead to the origin station. | |
OrderID | GetDestOrderId () const |
Get the order id that lead to the destination station. | |
Owner | GetOwner () const |
Get the owner of this link. | |
VehicleType | GetVehicleType () const |
Get the type of the vehicles on this link. | |
uint32 | GetTravelTime () const |
Get the travel time of this link. | |
uint16 | GetWaitTime () const |
Get the wait time at the origin station. | |
void | SetDestination (StationID dest_id, OrderID dest_order_id) |
Update the destination of the route link. | |
void | UpdateTravelTime (uint32 new_time) |
Update the travel time with a new travel time. | |
void | VehicleArrived () |
A vehicle arrived at the origin of the link, reset waiting time. | |
Private Attributes | |
StationID | dest |
Destination station id. | |
OrderID | prev_order |
Id of the order the vehicle had when arriving at the origin. | |
OrderID | next_order |
Id of the order the vehicle will leave the station with. | |
OwnerByte | owner |
Owner of the vehicle of the link. | |
VehicleTypeByte | vtype |
Vehicle type traveling this link. | |
uint32 | travel_time |
Average travel duration of this link. | |
uint16 | wait_time |
Days since the last vehicle traveled this link. | |
Friends | |
struct SaveLoad * | GetRouteLinkDescription () |
Saving and loading of route links. | |
void | AgeRouteLinks (Station *st) |
Age and expire route links of a station. |
Holds information about a route service between two stations.
Definition at line 101 of file cargodest_base.h.
StationID RouteLink::GetDestination | ( | ) | const [inline] |
Get the target station of this link.
Definition at line 126 of file cargodest_base.h.
References dest.
Referenced by CFollowRouteLinkT::Follow(), and CYapfCostRouteLinkT< Types >::RouteLinkCost().
OrderID RouteLink::GetDestOrderId | ( | ) | const [inline] |
Get the order id that lead to the destination station.
Definition at line 132 of file cargodest_base.h.
References next_order.
Referenced by CYapfCostRouteLinkT< Types >::RouteLinkCost(), and CYapfCostRouteLinkT< Types >::ValidLink().
OrderID RouteLink::GetOriginOrderId | ( | ) | const [inline] |
Get the order id that lead to the origin station.
Definition at line 129 of file cargodest_base.h.
References prev_order.
Referenced by CargoList< Tinst >::MoveTo(), CYapfCostRouteLinkT< Types >::RouteLinkCost(), StationCargoList::UpdateCargoNextHop(), and CYapfCostRouteLinkT< Types >::ValidLink().
Owner RouteLink::GetOwner | ( | ) | const [inline] |
Get the owner of this link.
Definition at line 135 of file cargodest_base.h.
References owner.
Referenced by CYapfCostRouteLinkT< Types >::ValidLink().
uint32 RouteLink::GetTravelTime | ( | ) | const [inline] |
Get the travel time of this link.
Definition at line 141 of file cargodest_base.h.
References travel_time.
Referenced by CYapfCostRouteLinkT< Types >::RouteLinkCost().
VehicleType RouteLink::GetVehicleType | ( | ) | const [inline] |
Get the type of the vehicles on this link.
Definition at line 138 of file cargodest_base.h.
References vtype.
Referenced by CYapfCostRouteLinkT< Types >::RouteLinkCost().
uint16 RouteLink::GetWaitTime | ( | ) | const [inline] |
Get the wait time at the origin station.
Definition at line 144 of file cargodest_base.h.
References wait_time.
Referenced by CYapfCostRouteLinkT< Types >::RouteLinkCost().
void RouteLink::SetDestination | ( | StationID | dest_id, | |
OrderID | dest_order_id | |||
) | [inline] |
Update the destination of the route link.
Definition at line 147 of file cargodest_base.h.
References dest, and next_order.
void RouteLink::UpdateTravelTime | ( | uint32 | new_time | ) | [inline] |
Update the travel time with a new travel time.
Definition at line 154 of file cargodest_base.h.
References travel_time.
void RouteLink::VehicleArrived | ( | ) | [inline] |
A vehicle arrived at the origin of the link, reset waiting time.
Definition at line 161 of file cargodest_base.h.
References wait_time.
void AgeRouteLinks | ( | Station * | st | ) | [friend] |
Age and expire route links of a station.
Definition at line 1176 of file cargodest.cpp.
struct SaveLoad* GetRouteLinkDescription | ( | ) | [friend] |
Saving and loading of route links.
Definition at line 131 of file cargodest_sl.cpp.