+unsigned VehicleType::get_max_function() const
+{
+ if(functions.empty())
+ return 0;
+ return (--functions.end())->first;
+}
+
+float VehicleType::get_front_axle_offset() const
+{
+ float front = length/2;
+ if(!axles.empty())
+ front = axles.front().position;
+ if(!bogies.empty())
+ {
+ const Bogie &bogie = bogies.front();
+ front = max(front, bogie.position+bogie.axles.front().position);
+ }
+ return front;
+}
+
+float VehicleType::get_back_axle_offset() const
+{
+ float back = -length/2;
+ if(!axles.empty())
+ back = axles.back().position;
+ if(!bogies.empty())
+ {
+ const Bogie &bogie = bogies.back();
+ back = min(back, bogie.position+bogie.axles.back().position);
+ }
+ return back;
+}
+