]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/trainstatus.cpp
Sprinkle some comments on the routing system
[r2c2.git] / source / libr2c2 / trainstatus.cpp
index 777bc768b410dfda2a50c8014a46639ba98bc5b8..e786f8cbfdfdce79a37982fdd17993844d8340b5 100644 (file)
@@ -1,11 +1,4 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2011  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
 #include "catalogue.h"
 #include "layout.h"
 #include "train.h"
@@ -14,8 +7,6 @@ Distributed under the GPL
 
 using namespace Msp;
 
-#include <msp/io/print.h>
-
 namespace R2C2 {
 
 TrainStatus::TrainStatus(Train &t):
@@ -25,7 +16,7 @@ TrainStatus::TrainStatus(Train &t):
        check();
 }
 
-void TrainStatus::tick(const Time::TimeStamp &, const Time::TimeDelta &)
+void TrainStatus::tick(const Time::TimeDelta &)
 {
        check();
 }
@@ -34,7 +25,7 @@ void TrainStatus::check()
 {
        float scale = train.get_layout().get_catalogue().get_scale();
        int s = static_cast<int>(train.get_quantized_speed()*3.6/scale+0.5);
-       if(s==0 && train.is_active())
+       if(s==0 && train.get_block_allocator().is_active())
                s = -1;
 
        if(s!=speed)
@@ -47,7 +38,7 @@ void TrainStatus::check()
                }
                else if(s==-1)
                        status = "Waiting";
-               else if(!train.get_vehicle(0).get_track())
+               else if(!train.get_vehicle(0).is_placed())
                        status = "Unplaced";
                else
                        status = "Stopped";