* Find a roadstop at given tile * @param tile tile with roadstop * @param type roadstop type * @return pointer to RoadStop * @pre there has to be roadstop of given type there! */ static */
| 251 | * @pre there has to be roadstop of given type there! |
| 252 | */ |
| 253 | /* static */ RoadStop *RoadStop::GetByTile(TileIndex tile, RoadStopType type) |
| 254 | { |
| 255 | const Station *st = Station::GetByTile(tile); |
| 256 | |
| 257 | for (RoadStop *rs = st->GetPrimaryRoadStop(type);; rs = rs->next) { |
| 258 | if (rs->xy == tile) return rs; |
| 259 | assert(rs->next != nullptr); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Leave the road stop |
nothing calls this directly
no test coverage detected