From: <wa...@us...> - 2012-06-29 14:53:37
|
Revision: 11347 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11347&view=rev Author: wardje Date: 2012-06-29 14:53:28 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Minor styleguide updates * Fix indentation * Correct comment Modified Paths: -------------- main/trunk/src/karts/controller/ai_base_controller.hpp main/trunk/src/karts/controller/default_ai_controller.cpp Modified: main/trunk/src/karts/controller/ai_base_controller.hpp =================================================================== --- main/trunk/src/karts/controller/ai_base_controller.hpp 2012-06-29 14:17:47 UTC (rev 11346) +++ main/trunk/src/karts/controller/ai_base_controller.hpp 2012-06-29 14:53:28 UTC (rev 11347) @@ -39,15 +39,15 @@ */ float m_skidding_threshold; - /** Stores the last N times when a collision happened. This is used - * to detect when the AI is stuck, i.e. N collisions happened in - * a certain period of time. */ - std::vector<float> m_collision_times; - - /** A flag that is set during the physics processing to indicate that - * this kart is stuck and needs to be rescued. */ - bool m_stuck_trigger_rescue; + /** Stores the last N times when a collision happened. This is used + * to detect when the AI is stuck, i.e. N collisions happened in + * a certain period of time. */ + std::vector<float> m_collision_times; + /** A flag that is set during the physics processing to indicate that + * this kart is stuck and needs to be rescued. */ + bool m_stuck_trigger_rescue; + protected: /** Length of the kart, storing it here saves many function calls. */ float m_kart_length; @@ -88,27 +88,27 @@ void setSteering (float angle, float dt); void setSkiddingFraction(float f); void computePath(); - // ------------------------------------------------------------------------ - /** This can be called to detect if the kart is stuck (i.e. repeatedly - * hitting part of the track). */ - bool isStuck() const { return m_stuck_trigger_rescue; } + // ------------------------------------------------------------------------ + /** This can be called to detect if the kart is stuck (i.e. repeatedly + * hitting part of the track). */ + bool isStuck() const { return m_stuck_trigger_rescue; } public: AIBaseController(AbstractKart *kart, StateManager::ActivePlayer *player=NULL); virtual ~AIBaseController() {}; - virtual void reset(); + virtual void reset(); virtual void crashed(const AbstractKart *k) {}; virtual void crashed(const Material *m); - virtual void handleZipper(bool play_sound) {}; - virtual void finishedRace(float time) {}; + virtual void handleZipper(bool play_sound) {}; + virtual void finishedRace(float time) {}; virtual void collectedItem(const Item &item, int add_info=-1, float previous_energy=0) {}; - virtual void setPosition(int p) {}; - virtual bool isNetworkController() const { return false; } - virtual bool isPlayerController() const { return false; } - virtual void action(PlayerAction action, int value) {}; - virtual void skidBonusTriggered() {}; + virtual void setPosition(int p) {}; + virtual bool isNetworkController() const { return false; } + virtual bool isPlayerController() const { return false; } + virtual void action(PlayerAction action, int value) {}; + virtual void skidBonusTriggered() {}; }; // AIBaseController Modified: main/trunk/src/karts/controller/default_ai_controller.cpp =================================================================== --- main/trunk/src/karts/controller/default_ai_controller.cpp 2012-06-29 14:17:47 UTC (rev 11346) +++ main/trunk/src/karts/controller/default_ai_controller.cpp 2012-06-29 14:53:28 UTC (rev 11347) @@ -189,13 +189,13 @@ return; } - // If the kart needs to be rescued, do it now (and nothing else) - if(isStuck() && !m_kart->getKartAnimation()) - { - new RescueAnimation(m_kart); - AIBaseController::update(dt); - return; - } + // If the kart needs to be rescued, do it now (and nothing else) + if(isStuck() && !m_kart->getKartAnimation()) + { + new RescueAnimation(m_kart); + AIBaseController::update(dt); + return; + } if( m_world->isStartPhase() ) { @@ -994,7 +994,7 @@ } // findNonCrashingPoint //----------------------------------------------------------------------------- -/** calc_steps() divides the velocity vector by the lenght of the kart, +/** calcSteps() divides the velocity vector by the length of the kart, * and gets the number of steps to use for the sight line of the kart. * The calling sequence guarantees that m_future_sector is not UNKNOWN. */ @@ -1025,7 +1025,7 @@ } // calcSteps //----------------------------------------------------------------------------- -/**FindCurve() gathers info about the closest sectors ahead: the curve +/**findCurve() gathers info about the closest sectors ahead: the curve * angle, the direction of the next turn, and the optimal speed at which the * curve can be travelled at it's widest angle. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |