Changeset 11062
- Timestamp:
- Jan 13, 2016, 11:13:30 PM (9 years ago)
- Location:
- code/branches/cpp11_v3/src
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3/src/libraries/core/GUIManager.cc
r11054 r11062 267 267 ArgumentCompletionList names; 268 268 const std::vector<std::string> guis = GUIManager::getInstance().getLoadedGUIs(); 269 for ( size_t i = 0; i < guis.size(); ++i)270 names.push_back(ArgumentCompletionListElement(gui s[i], getLowercase(guis[i])));269 for (const std::string gui : guis) 270 names.push_back(ArgumentCompletionListElement(gui, getLowercase(gui))); 271 271 return names; 272 272 } -
code/branches/cpp11_v3/src/libraries/core/module/Plugin.cc
r11054 r11062 79 79 { 80 80 // only load module if it isn't already loaded. otherwise merely activate it. 81 if (this->moduleInstance_ == NULL)81 if (this->moduleInstance_ == nullptr) 82 82 this->loadModule(); 83 83 else … … 112 112 Core::getInstance().unloadModule(this->moduleInstance_); 113 113 delete this->moduleInstance_; 114 this->moduleInstance_ = NULL;114 this->moduleInstance_ = nullptr; 115 115 } 116 116 void Plugin::deactivateModule() -
code/branches/cpp11_v3/src/modules/overlays/hud/HUDHealthBar.h
r11061 r11062 112 112 { this->owner_ = owner; } 113 113 protected: 114 virtual void positionChanged() ;115 virtual void sizeChanged() ;114 virtual void positionChanged() override; 115 virtual void sizeChanged() override; 116 116 private: 117 117 void positionText(); -
code/branches/cpp11_v3/src/modules/weapons/munitions/FusionMunition.h
r11057 r11062 52 52 public: 53 53 FusionMunition(Context* context); 54 virtual ~FusionMunition() {}54 virtual ~FusionMunition() = default; 55 55 }; 56 56 } -
code/branches/cpp11_v3/src/modules/weapons/munitions/GravityBombMunition.h
r11057 r11062 27 27 public: 28 28 GravityBombMunition(Context* context); 29 virtual ~GravityBombMunition() {}29 virtual ~GravityBombMunition() = default; 30 30 }; 31 31 -
code/branches/cpp11_v3/src/modules/weapons/munitions/IceMunition.h
r11057 r11062 52 52 public: 53 53 IceMunition(Context* context); 54 virtual ~IceMunition() {}54 virtual ~IceMunition() = default; 55 55 }; 56 56 } -
code/branches/cpp11_v3/src/modules/weapons/munitions/LaserMunition.h
r11057 r11062 52 52 public: 53 53 LaserMunition(Context* context); 54 virtual ~LaserMunition() {}54 virtual ~LaserMunition() = default; 55 55 }; 56 56 } -
code/branches/cpp11_v3/src/modules/weapons/munitions/LightningMunition.h
r11057 r11062 52 52 public: 53 53 LightningMunition(Context* context); 54 virtual ~LightningMunition() {}54 virtual ~LightningMunition() = default; 55 55 }; 56 56 } -
code/branches/cpp11_v3/src/modules/weapons/munitions/MineMunition.h
r11057 r11062 52 52 public: 53 53 MineMunition(Context* context); 54 virtual ~MineMunition() {}54 virtual ~MineMunition() = default; 55 55 }; 56 56 } -
code/branches/cpp11_v3/src/modules/weapons/munitions/RocketMunition.h
r11057 r11062 52 52 public: 53 53 RocketMunition(Context* context); 54 virtual ~RocketMunition() {}54 virtual ~RocketMunition() = default; 55 55 }; 56 56 } -
code/branches/cpp11_v3/src/modules/weapons/munitions/SplitMunition.h
r11057 r11062 52 52 public: 53 53 SplitMunition(Context* context); 54 virtual ~SplitMunition() {}54 virtual ~SplitMunition() = default; 55 55 }; 56 56 } -
code/branches/cpp11_v3/src/orxonox/gametypes/Dynamicmatch.cc
r11054 r11062 88 88 Dynamicmatch::~Dynamicmatch() 89 89 { 90 for ( std::set<Timer*>::iterator it = this->piggyTimers_.begin(); it != this->piggyTimers_.end(); ++it)91 delete (*it);90 for (Timer* timer : this->piggyTimers_) 91 delete timer; 92 92 } 93 93 -
code/branches/cpp11_v3/src/orxonox/overlays/OverlayGroup.cc
r11054 r11062 51 51 { 52 52 ArgumentCompletionList names; 53 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>().begin(); it; ++it)54 names.push_back(ArgumentCompletionListElement( it->getName(), getLowercase(it->getName())));53 for (OverlayGroup* overlayGroup : ObjectList<OverlayGroup>()) 54 names.push_back(ArgumentCompletionListElement(overlayGroup->getName(), getLowercase(overlayGroup->getName()))); 55 55 return names; 56 56 } -
code/branches/cpp11_v3/src/orxonox/weaponsystem/Munition.cc
r11054 r11062 52 52 this->reloadTime_ = 0.5f; 53 53 54 this->lastFilledWeaponMode_ = NULL;54 this->lastFilledWeaponMode_ = nullptr; 55 55 } 56 56 … … 200 200 magazine->munition_ = 0; 201 201 202 if (this->reload( NULL))202 if (this->reload(nullptr)) 203 203 // Successfully reloaded, continue recursively 204 204 return this->takeMunition(amount, 0); … … 271 271 if (it->first == lastFilledWeaponMode_) 272 272 { 273 lastFilledWeaponMode_ = NULL;273 lastFilledWeaponMode_ = nullptr; 274 274 } 275 275 delete it->second; … … 315 315 { 316 316 // Stacking munition means, if a magazine gets full, the munition adds to a new magazine 317 Magazine* magazine = this->getMagazine( NULL);317 Magazine* magazine = this->getMagazine(nullptr); 318 318 if (magazine) 319 319 { … … 347 347 // If the pointer to the weapon mode whose magazine got munition added to is NULL, then set the iterator to the beginning of the map 348 348 // Otherwise set it to the next weapon mode 349 if (lastFilledWeaponMode_ == NULL)349 if (lastFilledWeaponMode_ == nullptr) 350 350 { 351 351 it = this->assignedMagazines_.begin(); … … 441 441 for (unsigned int i = 0; i < addedMagazines; ++i) 442 442 { 443 for ( std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)444 { 445 if (needReload( it->first))446 { 447 reload( it->first);443 for (const auto& mapEntry : this->assignedMagazines_) 444 { 445 if (needReload(mapEntry.first)) 446 { 447 reload(mapEntry.first); 448 448 break; 449 449 } … … 523 523 if (it->first == lastFilledWeaponMode_) 524 524 { 525 lastFilledWeaponMode_ = NULL;525 lastFilledWeaponMode_ = nullptr; 526 526 } 527 527 delete it->second; -
code/branches/cpp11_v3/src/orxonox/weaponsystem/Munition.h
r11052 r11062 39 39 namespace orxonox 40 40 { 41 namespaceMunitionDeployment41 enum class MunitionDeployment 42 42 { 43 enum Value 44 { 45 Separate, // Every comsuming weapon mode has its own magazine. It is possible that one weapon mode is out of ammo while another still has some. 46 Share, // All comsuming weapon modes take their munition from the same magazine. If this magazine is empty a new one is loaded. 47 Stack // There is only one magazine where all the munition is stored. Use this deployment mode for heavy weapons loke rockets, bombs, ... 48 }; 49 } 43 Separate, // Every comsuming weapon mode has its own magazine. It is possible that one weapon mode is out of ammo while another still has some. 44 Share, // All comsuming weapon modes take their munition from the same magazine. If this magazine is empty a new one is loaded. 45 Stack // There is only one magazine where all the munition is stored. Use this deployment mode for heavy weapons loke rockets, bombs, ... 46 }; 50 47 51 48 class _OrxonoxExport Munition : public BaseObject … … 69 66 virtual ~Munition(); 70 67 71 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;68 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 72 69 73 70 unsigned int getNumMunition(WeaponMode* user) const; … … 80 77 inline unsigned int getMaxMunitionPerMagazine() const 81 78 { return this->maxMunitionPerMagazine_; } 82 inline MunitionDeployment ::ValuegetMunitionDeployment() const79 inline MunitionDeployment getMunitionDeployment() const 83 80 { return deployment_; } 84 81 … … 115 112 std::map<WeaponMode*, Magazine*> assignedMagazines_; // Maps weapon modes to magazines that are currently used. 116 113 117 MunitionDeployment ::Valuedeployment_; // Defines the behaviour how munition and magazines are distributed to the consuming weapon modes.114 MunitionDeployment deployment_; // Defines the behaviour how munition and magazines are distributed to the consuming weapon modes. 118 115 119 116 bool bAllowMunitionRefilling_; -
code/branches/cpp11_v3/src/orxonox/weaponsystem/Weapon.cc
r11054 r11062 158 158 void Weapon::updateMunition() 159 159 { 160 for ( std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)161 it->second->updateMunition();160 for (const auto& mapEnty : this->weaponmodes_) 161 mapEnty.second->updateMunition(); 162 162 } 163 163 } -
code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponPack.cc
r11059 r11062 159 159 void WeaponPack::updateMunition() 160 160 { 161 for ( std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)162 (*it)->updateMunition();161 for (Weapon* weapon : this->weapons_) 162 weapon->updateMunition(); 163 163 } 164 164 } -
code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponSystem.cc
r11059 r11062 312 312 else 313 313 { 314 return NULL;314 return nullptr; 315 315 } 316 316 } … … 318 318 void WeaponSystem::addMunition(Munition* munition) 319 319 { 320 if (munition == NULL)320 if (munition == nullptr) 321 321 { 322 322 return; … … 338 338 void WeaponSystem::updateMunition() 339 339 { 340 for ( std::vector<WeaponPack*>::iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)341 { 342 (*it)->updateMunition();340 for (WeaponPack* weaponPack : this->weaponPacks_) 341 { 342 weaponPack->updateMunition(); 343 343 } 344 344 } -
code/branches/cpp11_v3/src/orxonox/worldentities/TeamSpawnPoint.h
r11054 r11062 49 49 unsigned int getTeamNumber() const 50 50 { return this->teamNumber_; } 51 virtual Pawn* spawn() ;51 virtual Pawn* spawn() override; 52 52 53 53 private: -
code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.cc
r11059 r11062 86 86 this->aimPosition_ = Vector3::ZERO; 87 87 88 //this->explosionPartList_ = NULL;88 //this->explosionPartList_ = nullptr; 89 89 90 90 if (GameMode::isMaster()) … … 523 523 Munition* Pawn::getMunitionXML() const 524 524 { 525 return NULL;525 return nullptr; 526 526 } 527 527 … … 533 533 } 534 534 535 return NULL;535 return nullptr; 536 536 } 537 537
Note: See TracChangeset
for help on using the changeset viewer.