diff options
Diffstat (limited to 'Stars45/CarrierAI.cpp')
-rw-r--r-- | Stars45/CarrierAI.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Stars45/CarrierAI.cpp b/Stars45/CarrierAI.cpp index 235a073..dc55dc5 100644 --- a/Stars45/CarrierAI.cpp +++ b/Stars45/CarrierAI.cpp @@ -30,7 +30,7 @@ #include "Callsign.h" #include "NetUtil.h" -#include "Game.h" +#include "Clock.h" #include "Random.h" // +----------------------------------------------------------------------+ @@ -49,7 +49,7 @@ CarrierAI::CarrierAI(Ship* s, int level) if (ship) flight_planner = new(__FILE__,__LINE__) FlightPlanner(ship); - hold_time = (int) Game::GetInstance()->GetClock()->GameTime(); + hold_time = (int) Clock::GetInstance()->GameTime(); } } @@ -69,13 +69,13 @@ CarrierAI::ExecFrame(double secs) if (!sim || !ship || !hangar) return; - if (((int) Game::GetInstance()->GetClock()->GameTime() - hold_time >= INIT_HOLD) && - ((int) Game::GetInstance()->GetClock()->GameTime() - exec_time > EXEC_PERIOD)) { + if (((int) Clock::GetInstance()->GameTime() - hold_time >= INIT_HOLD) && + ((int) Clock::GetInstance()->GameTime() - exec_time > EXEC_PERIOD)) { CheckHostileElements(); CheckPatrolCoverage(); - exec_time = (int) Game::GetInstance()->GetClock()->GameTime(); + exec_time = (int) Clock::GetInstance()->GameTime(); } } @@ -132,7 +132,7 @@ CarrierAI::CheckPatrolCoverage() } } - else if (Game::GetInstance()->GetClock()->GameTime() - hangar->GetLastPatrolLaunch() > PATROL_PERIOD || + else if (Clock::GetInstance()->GameTime() - hangar->GetLastPatrolLaunch() > PATROL_PERIOD || hangar->GetLastPatrolLaunch() == 0) { Element* patrol = CreatePackage(0, 2, Mission::PATROL, 0, "ACM Medium Range"); if (patrol) { @@ -141,7 +141,7 @@ CarrierAI::CheckPatrolCoverage() if (flight_planner) flight_planner->CreatePatrolRoute(patrol, i); - hangar->SetLastPatrolLaunch(Game::GetInstance()->GetClock()->GameTime()); + hangar->SetLastPatrolLaunch(Clock::GetInstance()->GameTime()); return true; } } @@ -194,7 +194,7 @@ CarrierAI::CheckHostileElements() // nobody is assigned yet, create an attack package if (!found && CreateStrike(elem)) { - hold_time = (int) Game::GetInstance()->GetClock()->GameTime() + 30000; + hold_time = (int) Clock::GetInstance()->GameTime() + 30000; return true; } } |