Changeset 10071 for code/branches/modularships/src/orxonox/worldentities
- Timestamp:
- May 22, 2014, 2:18:47 PM (11 years ago)
- Location:
- code/branches/modularships/src/orxonox/worldentities/pawns
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10067 r10071 50 50 namespace orxonox 51 51 { 52 SetConsoleCommand("ModularSpaceShip", "killshippart", &ModularSpaceShip::killShipPart );52 SetConsoleCommand("ModularSpaceShip", "killshippart", &ModularSpaceShip::killShipPartStatic); 53 53 54 54 RegisterClass(ModularSpaceShip); … … 174 174 /** 175 175 @brief 176 STATIC: Needed for consolecommand. Kills the ShipPart with the given name. Used from the console-command "ModularSpaceShip killshippart [string]". 177 @param name 178 The name of the part to be killed. 179 */ 180 void ModularSpaceShip::killShipPartStatic(std::string name) 181 { 182 for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_s->begin(); it != ModularSpaceShip::partMap_s->end(); ++it) 183 { 184 if (it->second->getName() == name) 185 { 186 it->second->setAlive(false); 187 return; 188 } 189 } 190 orxout(internal_warning) << "Could not apply damage to ShipPart \"" << name << "\". Part not found." << endl; 191 } 192 193 /** 194 @brief 176 195 Kills the ShipPart with the given name. Used from the console-command "ModularSpaceShip killshippart [string]". 177 196 @param name … … 180 199 void ModularSpaceShip::killShipPart(std::string name) 181 200 { 182 for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_ s->begin(); it != ModularSpaceShip::partMap_s->end(); ++it)201 for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_.begin(); it != ModularSpaceShip::partMap_.end(); ++it) 183 202 { 184 203 if (it->second->getName() == name) 185 204 { 186 it->second-> death();205 it->second->setAlive(false); 187 206 return; 188 207 } -
code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.h
r10058 r10071 113 113 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL); 114 114 115 static void killShipPart(std::string name); 115 static void killShipPartStatic(std::string name); 116 void killShipPart(std::string name); 116 117 117 118 void addShipPart(ShipPart* part);
Note: See TracChangeset
for help on using the changeset viewer.