namespace Marklin {
class ControlModel;
-class LocoType;
class Route;
class Timetable;
class Vehicle;
+class VehicleType;
class Train: public sigc::trackable
{
{
private:
Block *prev_block;
+ bool blocks_valid;
public:
Loader(Train &);
};
Layout &layout;
- const LocoType &loco_type;
+ const VehicleType &loco_type;
unsigned address;
std::string name;
+ int priority;
std::vector<Vehicle *> vehicles;
std::list<BlockRef> cur_blocks;
std::list<BlockRef> rsv_blocks;
float travel_dist;
bool pure_speed;
std::vector<RealSpeed> real_speed;
+ bool accurate_position;
+ float overshoot_dist;
public:
- Train(Layout &, const LocoType &, unsigned);
+ Train(Layout &, const VehicleType &, unsigned);
~Train();
Layout &get_layout() const { return layout; }
- const LocoType &get_locomotive_type() const { return loco_type; }
+ const VehicleType &get_locomotive_type() const { return loco_type; }
unsigned get_address() const { return address; }
void set_name(const std::string &);
const std::string &get_name() const { return name; }
+ void set_priority(int);
+ int get_priority() const { return priority; }
ControlModel &get_control() const { return *control; }
+ void add_vehicle(const VehicleType &);
+ void remove_vehicle(unsigned);
+ unsigned get_n_vehicles() const;
Vehicle &get_vehicle(unsigned);
const Vehicle &get_vehicle(unsigned) const;
bool get_function(unsigned) const;
unsigned get_functions() const { return functions; }
+ void set_timetable(Timetable *);
+ Timetable *get_timetable() { return timetable; }
+
void set_route(const Route *);
void go_to(const Track &);
const Route *get_route() const { return route; }
void loco_func_event(unsigned, unsigned, bool);
void sensor_event(unsigned, bool);
void turnout_event(unsigned, bool);
+ void halt_event(bool);
void block_reserved(const Block &, const Train *);
unsigned reserve_more();
float get_real_speed(unsigned) const;