function 2 "telex";
function 3 "sfx";
function 5 "whst";
+ maximum_speed 0.255;
length 160;
width 37;
locomotive true;
function 0 "light";
function 2 "telex";
+ maximum_speed 0.255;
length 144;
width 33;
name "BR 185";
locomotive true;
function 0 "light";
+ maximum_speed 0.447;
length 218;
width 34;
name "BR 194";
locomotive true;
function 0 "light";
+ maximum_speed 0.287;
length 212;
width 34;
function 0 "light";
function 3 "sfx";
function 5 "whstl";
+ maximum_speed 0.383;
length 180;
width 35;
function 2 "sfx";
function 3 "whstl";
swap_direction true;
+ maximum_speed 0.639;
length 219;
width 35;
function 1 "intlt";
function 2 "sfx";
function 3 "whstl";
+ maximum_speed 0.383;
length 268;
width 33;
function 0 "light";
function 1 "telex";
function 3 "whstl";
+ maximum_speed 0.319;
length 224;
width 35;
function 0 "light";
function 2 "sfx";
function 3 "whstl";
+ maximum_speed 0.160;
length 203;
width 35;
return controller->get_speed();
}
+float Train::get_maximum_speed() const
+{
+ float ms = 0;
+ for(vector<Vehicle *>::const_iterator i=vehicles.begin(); i!=vehicles.end(); ++i)
+ {
+ float vms = (*i)->get_type().get_maximum_speed();
+ if(ms<=0 || (vms>0 && vms<ms))
+ ms = vms;
+ }
+ return ms;
+}
+
bool Train::get_function(unsigned func) const
{
return (functions>>func)&1;
float get_speed() const;
float get_quantized_speed() const;
unsigned get_speed_step() const { return current_speed_step; }
+ float get_maximum_speed() const;
bool get_function(unsigned) const;
unsigned get_functions() const { return functions; }
length(0),
width(0),
height(0),
- rotate_object(false)
+ rotate_object(false),
+ max_speed(0)
{ }
unsigned VehicleType::get_max_function() const
add("height", &Loader::height);
add("length", &Loader::length);
add("locomotive", &VehicleType::locomotive);
+ add("maximum_speed", &VehicleType::max_speed);
add("mirror_rods", &Loader::mirror_rods);
add("object", &VehicleType::object);
add("rod", &Loader::rod);
RodArray rods;
std::string object;
bool rotate_object;
+ float max_speed;
public:
VehicleType(const ArticleNumber &);
float get_back_axle_offset() const;
const std::string &get_object() const { return object; }
bool get_rotate_object() const { return rotate_object; }
+ float get_maximum_speed() const { return max_speed; }
};
} // namespace R2C2