From af53a0c2fa71ef37199d703e5badb347d945338b Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Wed, 6 Jan 2010 08:14:52 +0000 Subject: [PATCH] Make the stopped/going information available from IController --- include/IController.hpp | 2 ++ src/Engine.cpp | 1 + src/Train.cpp | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/IController.hpp b/include/IController.hpp index 334103b..b635e90 100644 --- a/include/IController.hpp +++ b/include/IController.hpp @@ -48,6 +48,8 @@ struct IController { virtual bool brakeOn() const = 0; virtual double pressure() const = 0; virtual double temp() const = 0; + + virtual bool stopped() const = 0; }; typedef shared_ptr IControllerPtr; diff --git a/src/Engine.cpp b/src/Engine.cpp index 7ce9963..1c6b44c 100644 --- a/src/Engine.cpp +++ b/src/Engine.cpp @@ -77,6 +77,7 @@ public: double pressure() const { return myBoilerPressure; } double temp() const { return myFireTemp; } track::Choice consumeChoice(); + bool stopped() const { return haveStopped; } // IXMLCallback interface void text(const string& localName, const string& aString); diff --git a/src/Train.cpp b/src/Train.cpp index 2612d1a..bc5e120 100644 --- a/src/Train.cpp +++ b/src/Train.cpp @@ -53,9 +53,9 @@ private: IRollingStockPtr vehicle; - // The length of a track segment can be found by calling segmentLength() - // This delta value ranges from 0 to that length and indicates how far - // along the segment the train is + // The length of a track segment can be found by calling + // segmentLength() This delta value ranges from 0 to that length and + // indicates how far along the segment the train is ITrackSegmentPtr segment; double segmentDelta; track::TravelToken travelToken; -- 2.39.2