Changeset 7338 in orxonox.OLD for trunk/src/world_entities/playable.cc
- Timestamp:
- Apr 19, 2006, 1:25:07 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r7337 r7338 39 39 40 40 Playable::Playable() 41 : weaponMan(this) 41 : weaponMan(this), 42 supportedPlaymodes(Playable::Full3D), 43 playmode(Playable::Full3D) 42 44 { 43 45 this->setClassID(CL_PLAYABLE, "Playable"); … … 90 92 this->weaponMan.removeWeapon(weapon); 91 93 92 94 this->weaponConfigChanged(); 93 95 } 94 96 … … 97 99 { 98 100 this->weaponMan.nextWeaponConfig(); 99 101 this->weaponConfigChanged(); 100 102 } 101 103 … … 104 106 { 105 107 this->weaponMan.previousWeaponConfig(); 106 108 this->weaponConfigChanged(); 107 109 } 108 110 … … 119 121 */ 120 122 void Playable::setCameraMode(unsigned int cameraMode) 121 { 122 123 {} 124 125 /** 126 * @brief sets the Playmode 127 * @param playmode the Playmode 128 * @returns true on success, false otherwise 129 */ 130 bool Playable::setPlayMode(Playable::Playmode playmode) 131 { 132 if (!this->playmodeSupported(playmode)) 133 return false; 134 else 135 this->playmode = playmode; 123 136 } 124 137 … … 155 168 if( this->getOwner() % 2 == 0) 156 169 { 157 // this->toList(OM_GROUP_00);170 // this->toList(OM_GROUP_00); 158 171 this->setAbsCoor(213.37, 57.71, -47.98); 159 172 this->setAbsDir(0, 0, 1, 0); … … 161 174 else 162 175 { // red team 163 // this->toList(OM_GROUP_01);176 // this->toList(OM_GROUP_01); 164 177 this->setAbsCoor(-314.450, 40.701, 83.554); 165 178 this->setAbsDir(1.0, -0.015, -0.012, 0.011); … … 179 192 { 180 193 PRINTF(0)("Playable dies\n"); 181 // only if this is the spaceship of the player194 // only if this is the spaceship of the player 182 195 if (State::isOnline()) 183 196 { … … 185 198 State::getGameRules()->onPlayerDeath(); 186 199 187 // this->toList(OM_GROUP_05);188 //HACK: moves the entity to an unknown place far far away: in the future, GameRules will look for that200 // this->toList(OM_GROUP_05); 201 //HACK: moves the entity to an unknown place far far away: in the future, GameRules will look for that 189 202 this->setAbsCoor(-2000.0, -2000.0, -2000.0); 190 203 191 //explosion hack204 //explosion hack 192 205 193 206 } … … 216 229 // unsubscibe all events. 217 230 EventHandler* evh = EventHandler::getInstance(); 218 std:: list<int>::iterator ev;231 std::vector<int>::iterator ev; 219 232 for (ev = this->events.begin(); ev != events.end(); ev++) 220 233 evh->unsubscribe( ES_GAME, (*ev)); … … 242 255 /*EventHandler*/ 243 256 EventHandler* evh = EventHandler::getInstance(); 244 std:: list<int>::iterator ev;257 std::vector<int>::iterator ev; 245 258 for (ev = this->events.begin(); ev != events.end(); ev++) 246 259 evh->subscribe(player, ES_GAME, (*ev)); … … 256 269 bool Playable::pickup(PowerUp* powerUp) 257 270 { 258 if(powerUp->isA(CL_WEAPON_POWER_UP)) { 271 if(powerUp->isA(CL_WEAPON_POWER_UP)) 272 { 259 273 return dynamic_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager()); 260 274 } 261 else if(powerUp->isA(CL_PARAM_POWER_UP)) { 275 else if(powerUp->isA(CL_PARAM_POWER_UP)) 276 { 262 277 ParamPowerUp* ppu = dynamic_cast<ParamPowerUp*>(powerUp); 263 switch(ppu->getType()) { 278 switch(ppu->getType()) 279 { 264 280 case POWERUP_PARAM_HEALTH: 265 281 this->increaseHealth(ppu->getValue()); … … 291 307 void Playable::unregisterEvent(int eventType) 292 308 { 293 this->events.remove(eventType); 309 std::vector<int>::iterator rmEvent = std::find(this->events.begin(), this->events.end(), eventType); 310 this->events.erase(rmEvent); 294 311 295 312 if (this->currentPlayer != NULL) … … 338 355 339 356 void Playable::detachCamera() 340 { 341 } 357 {} 342 358 343 359 #define DATA_FLAGS 1
Note: See TracChangeset
for help on using the changeset viewer.