- Timestamp:
- Jan 4, 2016, 6:19:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS15/src/modules/hover/TimeHUD.cc
r11026 r11041 34 34 35 35 #include "core/CoreIncludes.h" 36 #include "core/XMLPort.h"37 36 #include "util/Convert.h" 38 37 #include "Hover.h" … … 46 45 RegisterObject(TimeHUD); 47 46 48 this-> _time= 0.0f;49 this-> _running= false;50 this->hoverGame = 0;47 this->time_ = 0.0f; 48 this->running_ = false; 49 this->hoverGame_ = 0; 51 50 setRunning(true); 52 }53 54 void TimeHUD::XMLPort(Element& xmlelement, XMLPort::Mode mode)55 {56 SUPER(TimeHUD, XMLPort, xmlelement, mode);57 51 } 58 52 … … 82 76 SUPER(TimeHUD, tick, dt); 83 77 84 if(this-> _running) {85 this-> _time+= dt;78 if(this->running_) { 79 this->time_ += dt; 86 80 } 87 if (this->hoverGame )81 if (this->hoverGame_) 88 82 { 89 this->setCaption(getTimeString(this-> _time));83 this->setCaption(getTimeString(this->time_)); 90 84 } 91 if(this->hoverGame ->getFlags() == 0)85 if(this->hoverGame_->getFlags() == 0) 92 86 setRunning(false); 93 87 … … 100 94 if (this->getOwner() && this->getOwner()->getGametype()) 101 95 { 102 this->hoverGame = orxonox_cast<Hover*>(this->getOwner()->getGametype());96 this->hoverGame_ = orxonox_cast<Hover*>(this->getOwner()->getGametype()); 103 97 } 104 98 else 105 99 { 106 this->hoverGame = 0;100 this->hoverGame_ = 0; 107 101 } 108 }109 110 /**111 @brief112 sets if the clock is running113 @param running114 */115 void TimeHUD::setRunning(bool running)116 {117 this->_running = running;118 }119 120 /**121 @brief122 returns if the clock is running123 @returns running124 */125 bool TimeHUD::isRunning() {126 return this->_running;127 102 } 128 103 129 104 void TimeHUD::reset() 130 105 { 131 this-> _time= 0;106 this->time_ = 0; 132 107 } 133 108 }
Note: See TracChangeset
for help on using the changeset viewer.