#include <msp/datafile/objectloader.h>
#include <msp/time/timedelta.h>
+#include "blockiter.h"
#include "geometry.h"
-#include "object.h"
#include "signaltype.h"
#include "track.h"
+#include "trackattachment.h"
namespace R2C2 {
-class Block;
class Layout;
class Train;
-class Signal: public Object
+class Signal: public TrackAttachment
{
public:
class Loader: public Msp::DataFile::ObjectLoader<Signal>
private:
const SignalType &type;
unsigned address;
- Track *track;
- Block *block;
- unsigned entry;
+ BlockIter block;
Train *train;
sigc::connection train_conn;
bool check_allocated_blocks;
virtual const SignalType &get_type() const { return type; }
void set_address(unsigned);
+ unsigned get_address() const { return address; }
virtual void set_position(const Vector &);
virtual void set_rotation(const Angle &);
+ virtual void set_tilt(const Angle &) { }
private:
- void normalize_location();
+ void update_attachment();
public:
- virtual Track *get_parent() const { return track; }
virtual unsigned get_n_snap_nodes() const;
virtual Snap get_snap_node(unsigned) const;
virtual SnapType get_default_snap_type_to(const Object &) const;
public:
- virtual bool collide_ray(const Vector &, const Vector &) const;
-
void tick(const Msp::Time::TimeDelta &);
private: