]> git.tdb.fi Git - r2c2.git/blob - libr2c2/clock.cpp
Don't crash if a train has no router
[r2c2.git] / libr2c2 / clock.cpp
1 #include "clock.h"
2
3 using namespace Msp;
4
5 namespace R2C2 {
6
7 Clock::Clock():
8         rate(1)
9 { }
10
11 void Clock::set_rate(float s)
12 {
13         rate = s;
14 }
15
16 void Clock::tick(const Time::TimeDelta &dt)
17 {
18         current_time += dt*rate;
19 }
20
21 } // namespace R2C2