| 805 | } |
| 806 | |
| 807 | OpenLoco::StationId OpenLoco::Station::id() const |
| 808 | { |
| 809 | // TODO check if this is stored in station structure |
| 810 | // otherwise add it when possible |
| 811 | auto index = (size_t)(this - &StationManager::rawStations()[0]); |
| 812 | if (index >= Limits::kMaxStations) |
| 813 | { |
| 814 | return StationId::null; |
| 815 | } |
| 816 | return StationId(index); |
| 817 | } |
no test coverage detected