diff options
Diffstat (limited to 'Stars45/Contact.cpp')
-rw-r--r-- | Stars45/Contact.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Stars45/Contact.cpp b/Stars45/Contact.cpp index a2912cb..cde6bcf 100644 --- a/Stars45/Contact.cpp +++ b/Stars45/Contact.cpp @@ -20,6 +20,7 @@ #include "WeaponDesign.h" #include "Game.h" +#include "Clock.h" // +----------------------------------------------------------------------+ @@ -34,14 +35,14 @@ Contact::Contact() : ship(0), shot(0), d_pas(0.0f), d_act(0.0f), track(0), ntrack(0), time(0), track_time(0), probe(false) { - acquire_time = Game::GetInstance()->GetClock()->GameTime(); + acquire_time = Clock::GetInstance()->GameTime(); } Contact::Contact(Ship* s, float p, float a) : ship(s), shot(0), d_pas(p), d_act(a), track(0), ntrack(0), time(0), track_time(0), probe(false) { - acquire_time = Game::GetInstance()->GetClock()->GameTime(); + acquire_time = Clock::GetInstance()->GameTime(); Observe(ship); } @@ -49,7 +50,7 @@ Contact::Contact(Shot* s, float p, float a) : ship(0), shot(s), d_pas(p), d_act(a), track(0), ntrack(0), time(0), track_time(0), probe(false) { - acquire_time = Game::GetInstance()->GetClock()->GameTime(); + acquire_time = Clock::GetInstance()->GameTime(); Observe(shot); } @@ -116,7 +117,7 @@ Contact::Age() const if (!ship && !shot) return age; - double seconds = (Game::GetInstance()->GetClock()->GameTime() - time) / 1000.0; + double seconds = (Clock::GetInstance()->GameTime() - time) / 1000.0; age = 1.0 - seconds/DEFAULT_TRACK_AGE; @@ -295,7 +296,7 @@ Contact::Reset() { if (Game::GetInstance()->Paused()) return; - float step_down = (float) (Game::GetInstance()->GetClock()->Delta() / 10); + float step_down = (float) (Clock::GetInstance()->Delta() / 10); if (d_pas > 0) d_pas -= step_down; @@ -327,7 +328,7 @@ Contact::ClearTrack() void Contact::UpdateTrack() { - time = Game::GetInstance()->GetClock()->GameTime(); + time = Clock::GetInstance()->GameTime(); if (shot || (ship && ship->IsGroundUnit())) return; |