- Timestamp:
- Nov 27, 2017, 5:00:59 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc
r11593 r11608 25 25 */ 26 26 27 #include " DodgeRaceHUDinfo.h"27 #include "Asteroids2DHUDinfo.h" 28 28 29 29 #include "core/CoreIncludes.h" 30 30 #include "core/XMLPort.h" 31 31 #include "util/Convert.h" 32 //#include " DodgeRace.h"32 //#include "Asteroids2D.h" 33 33 34 34 namespace orxonox 35 35 { 36 RegisterClass( DodgeRaceHUDinfo);36 RegisterClass(Asteroids2DHUDinfo); 37 37 38 DodgeRaceHUDinfo::DodgeRaceHUDinfo(Context* context) : OverlayText(context)38 Asteroids2DHUDinfo::Asteroids2DHUDinfo(Context* context) : OverlayText(context) 39 39 { 40 RegisterObject( DodgeRaceHUDinfo);40 RegisterObject(Asteroids2DHUDinfo); 41 41 42 this-> DodgeRaceGame = nullptr;42 this->Asteroids2DGame = nullptr; 43 43 this->bShowPoints_ = true; 44 44 } 45 45 46 void DodgeRaceHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)46 void Asteroids2DHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode) 47 47 { 48 SUPER( DodgeRaceHUDinfo, XMLPort, xmlelement, mode);48 SUPER(Asteroids2DHUDinfo, XMLPort, xmlelement, mode); 49 49 50 XMLPortParam( DodgeRaceHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);50 XMLPortParam(Asteroids2DHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false); 51 51 } 52 52 53 void DodgeRaceHUDinfo::tick(float dt)53 void Asteroids2DHUDinfo::tick(float dt) 54 54 { 55 SUPER( DodgeRaceHUDinfo, tick, dt);55 SUPER(Asteroids2DHUDinfo, tick, dt); 56 56 57 57 58 58 if(this->bShowPoints_) 59 59 { 60 const std::string& points = multi_cast<std::string>(this-> DodgeRaceGame->getPoints());61 if (this-> DodgeRaceGame->lives <= 0)60 const std::string& points = multi_cast<std::string>(this->Asteroids2DGame->getPoints()); 61 if (this->Asteroids2DGame->lives <= 0) 62 62 { 63 63 setTextSize(0.2); … … 76 76 } 77 77 78 void DodgeRaceHUDinfo::changedOwner()78 void Asteroids2DHUDinfo::changedOwner() 79 79 { 80 SUPER( DodgeRaceHUDinfo, changedOwner);80 SUPER(Asteroids2DHUDinfo, changedOwner); 81 81 82 82 if (this->getOwner() && this->getOwner()->getGametype()) 83 83 { 84 this-> DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype());84 this->Asteroids2DGame = orxonox_cast<Asteroids2D*>(this->getOwner()->getGametype()); 85 85 } 86 86 else 87 87 { 88 this-> DodgeRaceGame = nullptr;88 this->Asteroids2DGame = nullptr; 89 89 } 90 90 }
Note: See TracChangeset
for help on using the changeset viewer.