Changeset 2890 for code/trunk/src/orxonox/objects
- Timestamp:
- Apr 2, 2009, 8:42:11 PM (16 years ago)
- Location:
- code/trunk/src/orxonox/objects
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/gametypes/Gametype.cc
r2839 r2890 229 229 if (it != this->players_.end()) 230 230 it->second.frags_++; 231 } 232 233 int Gametype::getScore(PlayerInfo* player) const 234 { 235 std::map<PlayerInfo*, Player>::const_iterator it = this->players_.find(player); 236 if (it != this->players_.end()) 237 return it->second.frags_; 238 else 239 return 0; 231 240 } 232 241 -
code/trunk/src/orxonox/objects/gametypes/Gametype.h
r2839 r2890 107 107 { return this->players_; } 108 108 109 int getScore(PlayerInfo* player) const; 110 109 111 inline void registerSpawnPoint(SpawnPoint* spawnpoint) 110 112 { this->spawnpoints_.insert(spawnpoint); } -
code/trunk/src/orxonox/objects/gametypes/Pong.cc
r2885 r2890 53 53 this->bat_[0] = 0; 54 54 this->bat_[1] = 0; 55 56 this->setHUDTemplate("PongHUD"); 55 57 56 58 this->starttimer_.setTimer(1.0, false, this, createExecutor(createFunctor(&Pong::startBall))); … … 181 183 this->ball_->setSpeed(this->center_->getBallSpeed()); 182 184 } 185 186 PlayerInfo* Pong::getLeftPlayer() const 187 { 188 if (this->bat_ && this->bat_[0]) 189 return this->bat_[0]->getPlayer(); 190 else 191 return 0; 192 } 193 194 PlayerInfo* Pong::getRightPlayer() const 195 { 196 if (this->bat_ && this->bat_[1]) 197 return this->bat_[1]->getPlayer(); 198 else 199 return 0; 200 } 183 201 } -
code/trunk/src/orxonox/objects/gametypes/Pong.h
r2826 r2890 53 53 { this->center_ = center; } 54 54 55 PlayerInfo* getLeftPlayer() const; 56 PlayerInfo* getRightPlayer() const; 57 55 58 protected: 56 59 void startBall(); -
code/trunk/src/orxonox/objects/infos/HumanPlayer.cc
r2826 r2890 173 173 if (this->humanHud_) 174 174 this->humanHud_->setOwner(this->getControllableEntity()); 175 176 if (this->gametypeHud_)177 this->gametypeHud_->setOwner(this->getControllableEntity());178 175 } 179 176 … … 206 203 this->gametypeHud_ = new OverlayGroup(this); 207 204 this->gametypeHud_->addTemplate(this->gametypeHudTemplate_); 208 this->gametypeHud_->setOwner(this->get ControllableEntity());205 this->gametypeHud_->setOwner(this->getGametype()); 209 206 } 210 207 }
Note: See TracChangeset
for help on using the changeset viewer.