| 250 | } |
| 251 | |
| 252 | shared_ptr<VehicleModelInterface> VehicleModelFactory::GetVehicleModelForCountry(string const & country) const |
| 253 | { |
| 254 | string parent = country; |
| 255 | while (!parent.empty()) |
| 256 | { |
| 257 | auto it = m_models.find(parent); |
| 258 | if (it != m_models.end()) |
| 259 | return it->second; |
| 260 | |
| 261 | parent = GetParent(parent); |
| 262 | } |
| 263 | |
| 264 | return GetVehicleModel(); |
| 265 | } |
| 266 | |
| 267 | string VehicleModelFactory::GetParent(string const & country) const |
| 268 | { |