From 689fe5b78ec0256519ae7a32049528b31eec7e20 Mon Sep 17 00:00:00 2001 From: kmetykog Date: Sat, 23 Oct 2010 21:39:20 +0000 Subject: [PATCH] Ooops cosmetics... git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3049 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 776945b5f234d7ee8af7d55b03b13cdeadd4440f Former-commit-id: e7cef0f12a9f0ec8e2f1581ec46021d41c81a58e --- src/drivers/kilo2008/kdriver.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/drivers/kilo2008/kdriver.cpp b/src/drivers/kilo2008/kdriver.cpp index 3c2ff13e8..e7fed52eb 100644 --- a/src/drivers/kilo2008/kdriver.cpp +++ b/src/drivers/kilo2008/kdriver.cpp @@ -29,18 +29,25 @@ #include // Rt* #include // ROB_PIT_IM -#include // NOLINT(readability/streams), used for logging only #include #include #include +// #define DEBUG +#ifdef DEBUG +#include // NOLINT(readability/streams), used for logging only +using ::std::cout; +#endif + #include "src/drivers/kilo2008/opponent.h" #include "src/drivers/kilo2008/strategy.h" #include "src/drivers/kilo2008/pit.h" #include "src/drivers/kilo2008/raceline.h" #include "src/drivers/kilo2008/util.h" -// #define DEBUG +using ::std::string; +using ::std::stringstream; +using ::std::list; // "I AM DEATH, NOT TAXES. *I* TURN UP ONLY ONCE." -- Death // Fear was theirs, not yers. @@ -781,7 +788,7 @@ void KDriver::initTrack(tTrack * t, void *carHandle, // Create a pit stop strategy object. m_strategy = new KStrategy(); // Init fuel. - m_strategy->setFuelAtRaceStart(t, carParmHandle, s, INDEX); + m_strategy->SetFuelAtRaceStart(t, carParmHandle, s, INDEX); m_raceline = new LRaceLine; // m_raceline->setSkill(m_skill); @@ -809,7 +816,7 @@ void KDriver::update(tSituation * s) { m_currentSpeedSqr = pow(m_car->_speed_x, 2); m_opponents->update(s, this); - m_strategy->update(); + m_strategy->Update(); checkPitStatus(s); m_pit->update(); @@ -837,7 +844,7 @@ void KDriver::checkPitStatus(tSituation *s) { if ((m_car->_distFromStartLine < m_pit->getNPitEntry() || m_car->_distFromStartLine > m_pit->getNPitEnd()) || m_car->_fuel < 5.0) { - m_pit->setPitstop(m_strategy->needPitstop()); + m_pit->setPitstop(m_strategy->NeedPitstop()); } } // if no pit planned @@ -906,8 +913,8 @@ double KDriver::filterBColl(const double brake) { // Set pitstop commands. int KDriver::pitCommand(tSituation * s) { - m_car->_pitRepair = m_strategy->pitRepair(); - m_car->_pitFuel = m_strategy->pitRefuel(); + m_car->_pitRepair = m_strategy->PitRepair(); + m_car->_pitFuel = m_strategy->PitRefuel(); // This should be the only place where the pit stop is set to false! m_pit->setPitstop(false); return ROB_PIT_IM; // return immediately. @@ -915,7 +922,7 @@ int KDriver::pitCommand(tSituation * s) { void KDriver::newRace(tCarElt * car, tSituation * s) { - m_strategy->setCar(car); + m_strategy->set_car(car); double deltaTime = static_cast(RCM_MAX_DT_ROBOTS); MAX_UNSTUCK_COUNT = static_cast(UNSTUCK_TIME_LIMIT / deltaTime);