|
OpenTTD Source
13.2.1
|
An updatable edge class. More...
#include <linkgraph.h>
Public Member Functions | |
| Edge (BaseEdge &edge) | |
| Constructor. More... | |
| void | Update (uint capacity, uint usage, uint32 time, EdgeUpdateMode mode) |
| Update an edge. More... | |
| void | Restrict () |
| void | Release () |
Public Member Functions inherited from LinkGraph::EdgeWrapper< BaseEdge > | |
| EdgeWrapper (BaseEdge &edge) | |
| Wrap a an edge. More... | |
| uint | Capacity () const |
| Get edge's capacity. More... | |
| uint | Usage () const |
| Get edge's usage. More... | |
| uint32 | TravelTime () const |
| Get edge's average travel time. More... | |
| Date | LastUnrestrictedUpdate () const |
| Get the date of the last update to the edge's unrestricted capacity. More... | |
| Date | LastRestrictedUpdate () const |
| Get the date of the last update to the edge's restricted capacity. More... | |
| Date | LastUpdate () const |
| Get the date of the last update to any part of the edge's capacity. More... | |
Additional Inherited Members | |
Protected Attributes inherited from LinkGraph::EdgeWrapper< BaseEdge > | |
| BaseEdge & | edge |
| Actual edge to be used. | |
An updatable edge class.
Definition at line 299 of file linkgraph.h.
|
inline |
| void LinkGraph::Edge::Update | ( | uint | capacity, |
| uint | usage, | ||
| uint32 | travel_time, | ||
| EdgeUpdateMode | mode | ||
| ) |
Update an edge.
If mode contains UM_REFRESH refresh the edge to have at least the given capacity and usage, otherwise add the capacity, usage and travel time. In any case set the respective update timestamp(s), according to the given mode.
| capacity | Capacity to be added/updated. |
| usage | Usage to be added. |
| travel_time | Travel time to be added, in ticks. |
| mode | Update mode to be applied. |
Definition at line 271 of file linkgraph.cpp.
References _date, EUM_INCREASE, EUM_REFRESH, EUM_RESTRICTED, and EUM_UNRESTRICTED.