| 188 | */ |
| 189 | template <class T, VehicleType Type> |
| 190 | bool GroundVehicle<T, Type>::IsChainInDepot() const |
| 191 | { |
| 192 | const T *v = this->First(); |
| 193 | /* Is the front engine stationary in the depot? */ |
| 194 | static_assert((int)TRANSPORT_RAIL == (int)VEH_TRAIN); |
| 195 | static_assert((int)TRANSPORT_ROAD == (int)VEH_ROAD); |
| 196 | if (!IsDepotTypeTile(v->tile, (TransportType)Type) || v->cur_speed != 0) return false; |
| 197 | |
| 198 | /* Check whether the rest is also already trying to enter the depot. */ |
| 199 | for (; v != nullptr; v = v->Next()) { |
| 200 | if (!v->T::IsInDepot() || v->tile != this->tile) return false; |
| 201 | } |
| 202 | |
| 203 | return true; |
| 204 | } |
| 205 | |
| 206 | /* Instantiation for Train */ |
| 207 | template struct GroundVehicle<Train, VEH_TRAIN>; |
no test coverage detected