diff options
Diffstat (limited to 'src/rail.h')
-rw-r--r-- | src/rail.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rail.h b/src/rail.h index 539a162b8..320d24a9a 100644 --- a/src/rail.h +++ b/src/rail.h @@ -431,4 +431,13 @@ void ResetRailTypes(); void InitRailTypes(); RailType AllocateRailType(RailTypeLabel label); +extern RailType _sorted_railtypes[RAILTYPE_END]; +extern uint8 _sorted_railtypes_size; + +/** + * Loop header for iterating over railtypes, sorted by sortorder. + * @param var Railtype. + */ +#define FOR_ALL_SORTED_RAILTYPES(var) for (uint8 index = 0; index < _sorted_railtypes_size && (var = _sorted_railtypes[index], true) ; index++) + #endif /* RAIL_H */ |