Changeset 10159 for code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseHUDController.cc
- Timestamp:
- Dec 5, 2014, 4:27:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseHUDController.cc
r10140 r10159 39 39 { 40 40 RegisterObject(TowerDefenseHUDController); 41 this->td = 0; 41 42 } 42 43 … … 49 50 { 50 51 SUPER(TowerDefenseHUDController, tick, dt); 52 const std::string& lifes = multi_cast<std::string>(this->td->getLifes()); 53 const std::string& credits = multi_cast<std::string>(this->td->getCredit()); 54 const std::string& waves = multi_cast<std::string>(this->td->getWaveNumber()); 51 55 52 56 if(showlives == true) 53 this->setCaption(multi_cast<std::string>( this->td->life));57 this->setCaption(multi_cast<std::string>(lifes)); 54 58 else if(showcredits == true) 55 this->setCaption(multi_cast<std::string>( this->td->credits));59 this->setCaption(multi_cast<std::string>(credits)); 56 60 else if(showwaves == true) 57 this->setCaption(multi_cast<std::string>( this->td->waves));61 this->setCaption(multi_cast<std::string>(waves)); 58 62 59 63 … … 74 78 SUPER(TowerDefenseHUDController, changedOwner); 75 79 76 td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype().get()); 77 80 if (this->getOwner() && this->getOwner()->getGametype()) 81 { 82 this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype().get()); 83 } 84 else 85 { 86 this->td = 0; 87 } 88 } 78 89 /*if (this->getOwner() != NULL && this->getOwner()->getGametype()) 79 90 { … … 86 97 } 87 98 88 }
Note: See TracChangeset
for help on using the changeset viewer.