Changeset 2839 for code/trunk/src/orxonox/objects/gametypes
- Timestamp:
- Mar 25, 2009, 3:26:06 AM (15 years ago)
- Location:
- code/trunk/src/orxonox/objects/gametypes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/gametypes/Gametype.cc
r2826 r2839 200 200 // Reward killer 201 201 if (killer) 202 this->playerScored(killer->getPlayer()); 202 { 203 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(killer->getPlayer()); 204 if (it != this->players_.end()) 205 it->second.frags_++; 206 } 203 207 204 208 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator()); … … 348 352 { 349 353 for (unsigned int i = 0; i < amount; ++i) 350 new Bot(this);354 this->botclass_.fabricate(this); 351 355 } 352 356 -
code/trunk/src/orxonox/objects/gametypes/Gametype.h
r2826 r2839 142 142 float initialStartCountdown_; 143 143 unsigned int numberOfBots_; 144 SubclassIdentifier<Bot> botclass_; 144 145 145 146 std::map<PlayerInfo*, Player> players_; -
code/trunk/src/orxonox/objects/gametypes/Pong.cc
r2826 r2839 37 37 #include "objects/worldentities/PongBall.h" 38 38 #include "objects/worldentities/PongBat.h" 39 #include "objects/infos/PlayerInfo.h" 39 #include "objects/infos/HumanPlayer.h" 40 #include "objects/infos/PongBot.h" 41 #include "objects/controllers/PongAI.h" 40 42 41 43 namespace orxonox … … 56 58 this->starttimer_.setTimer(1.0, false, this, createExecutor(createFunctor(&Pong::startBall))); 57 59 this->starttimer_.stopTimer(); 60 61 this->botclass_ = Class(PongBot); 58 62 } 59 63 … … 133 137 this->players_[player].state_ = PlayerState::Alive; 134 138 } 139 else 140 return; 141 142 if (player && player->getController() && player->getController()->isA(Class(PongAI))) 143 { 144 PongAI* ai = dynamic_cast<PongAI*>(player->getController()); 145 ai->setPongBall(this->ball_); 146 } 135 147 } 136 148
Note: See TracChangeset
for help on using the changeset viewer.