#define LIBMARKLIN_TRAIN_H_
#include <sigc++/trackable.h>
-#include "section.h"
+#include "block.h"
namespace Marklin {
Train(TrafficManager &, Locomotive &);
const std::string &get_name() const { return name; }
void set_speed(unsigned);
- void place(Section *, const Section::Endpoint *);
- bool free_section(Section *);
+ void place(Block *, const Block::Endpoint *);
+ bool free_block(Block *);
void tick();
private:
- struct SectionRef
+ struct BlockRef
{
- Section *section;
- const Section::Endpoint *entry;
+ Block *block;
+ const Block::Endpoint *entry;
- SectionRef(Section *s, const Section::Endpoint *e): section(s), entry(e) { }
+ BlockRef(Block *s, const Block::Endpoint *e): block(s), entry(e) { }
};
- typedef std::list<SectionRef> SectRefSeq;
+ typedef std::list<BlockRef> BlockRefSeq;
TrafficManager &trfc_mgr;
std::string name;
Locomotive &loco;
- SectRefSeq cur_sections;
- SectRefSeq rsv_sections;
+ BlockRefSeq cur_blocks;
+ BlockRefSeq rsv_blocks;
unsigned target_speed;
void sensor_event(unsigned, bool);