* Get the RailType for this RailTypeInfo. * @return RailType in static RailTypeInfo definitions. */
| 24 | * @return RailType in static RailTypeInfo definitions. |
| 25 | */ |
| 26 | RailType RailTypeInfo::Index() const |
| 27 | { |
| 28 | extern RailTypeInfo _railtypes[RAILTYPE_END]; |
| 29 | size_t index = this - _railtypes; |
| 30 | assert(index < RAILTYPE_END); |
| 31 | return static_cast<RailType>(index); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile. |
no outgoing calls
no test coverage detected