]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/timetable.h
Remove the scripting-based timetable
[r2c2.git] / source / libr2c2 / timetable.h
diff --git a/source/libr2c2/timetable.h b/source/libr2c2/timetable.h
deleted file mode 100644 (file)
index f8fc8a0..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef LIBR2C2_TIMETABLE_H_
-#define LIBR2C2_TIMETABLE_H_
-
-#include <string>
-#include <vector>
-#include <sigc++/trackable.h>
-#include <msp/datafile/objectloader.h>
-#include "sensor.h"
-#include "trainai.h"
-
-namespace R2C2 {
-
-class Block;
-class Track;
-class Train;
-class Zone;
-
-class Timetable: public TrainAI, public sigc::trackable
-{
-public:
-       class Loader: public Msp::DataFile::ObjectLoader<Timetable>
-       {
-       public:
-               Loader(Timetable &);
-       private:
-               void arrive();
-               void goto_sensor(unsigned);
-               void goto_sensor_str(const std::string &);
-               void goto_zone(const std::string &);
-               void route(const std::string &);
-               void reverse();
-               void speed(unsigned);
-               void travel_to(unsigned);
-               void travel_past(unsigned);
-               void wait(unsigned);
-               void wait_train(unsigned, unsigned);
-               void wait_until(unsigned, unsigned);
-       };
-
-       enum RowType
-       {
-               GOTO_SENSOR,
-               GOTO_ZONE,
-               TRAVEL_TO,
-               TRAVEL_PAST,
-               WAIT_TIME,
-               WAIT_UNTIL,
-               WAIT_TRAIN,
-               ARRIVE,
-               SPEED,
-               REVERSE,
-               ROUTE
-       };
-
-       struct Row
-       {
-               RowType type;
-               std::vector<Msp::Variant> params;
-
-               Row(RowType);
-
-               template<typename T>
-               Row(RowType, const T &);
-
-               template<typename T>
-               const T &get_param(unsigned) const;
-
-               std::string str() const;
-
-               Msp::DataFile::Statement save() const;
-
-               static Row parse(const std::string &);
-       };
-
-private:
-       bool enabled;
-       std::vector<Row> rows;
-       unsigned current_row;
-       bool executing;
-       Block *pending_block;
-       Train *pending_train;
-       Msp::Time::TimeStamp wait_timeout;
-       bool arrived;
-
-public:
-       Timetable(Train &);
-
-       void set_enabled(bool);
-       bool is_enabled() const { return enabled; }
-       void reset();
-
-       void clear();
-       void append(const Row &);
-       void insert(unsigned, const Row &);
-       unsigned get_n_rows() const { return rows.size(); }
-       const Row &get_row(unsigned) const;
-
-       void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &);
-       void save(std::list<Msp::DataFile::Statement> &) const;
-private:
-       Block &get_sensor(unsigned);
-       Track &get_turnout(unsigned);
-       Zone &get_zone(const std::string &);
-       void sensor_state_changed(Sensor &, Sensor::State);
-       void block_reserved(Block &, Train *);
-       void train_advanced(Block &);
-       void event(TrainAI &, const Message &);
-};
-
-} // namespace R2C2
-
-#endif