Changeset 6394 for code/branches/presentation2/src/orxonox
- Timestamp:
- Dec 22, 2009, 2:07:44 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/Level.cc
r5929 r6394 141 141 void Level::playerEntered(PlayerInfo* player) 142 142 { 143 COUT(3) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ")"<< std::endl;143 COUT(3) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << std::endl; 144 144 player->setGametype(this->getGametype()); 145 145 } … … 147 147 void Level::playerLeft(PlayerInfo* player) 148 148 { 149 COUT(3) << "player left level (id: " << player->getClientID() << ", name: " << player->getName() << ")"<< std::endl;149 COUT(3) << "player left level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << std::endl; 150 150 player->setGametype(0); 151 151 } -
code/branches/presentation2/src/orxonox/LevelManager.cc
r6256 r6394 122 122 } 123 123 124 std::stringLevelManager::getAvailableLevelListItem(unsigned int index) const124 const std::string& LevelManager::getAvailableLevelListItem(unsigned int index) const 125 125 { 126 126 if (index >= availableLevels_.size()) 127 return std::string();127 return BLANKSTRING; 128 128 else 129 129 return availableLevels_[index]; -
code/branches/presentation2/src/orxonox/LevelManager.h
r5781 r6394 60 60 const std::string& getDefaultLevel() const; //tolua_export 61 61 void compileAvailableLevelList(); //tolua_export 62 std::stringgetAvailableLevelListItem(unsigned int index) const; //tolua_export62 const std::string& getAvailableLevelListItem(unsigned int index) const; //tolua_export 63 63 64 64 static LevelManager* getInstancePtr() { return singletonPtr_s; } -
code/branches/presentation2/src/orxonox/Radar.cc
r6314 r6394 85 85 } 86 86 87 RadarViewable::Shape Radar::addObjectDescription(const std::string name)87 RadarViewable::Shape Radar::addObjectDescription(const std::string& name) 88 88 { 89 89 std::map<std::string, RadarViewable::Shape>::iterator it = this->objectTypes_.find(name); -
code/branches/presentation2/src/orxonox/Radar.h
r5929 r6394 55 55 56 56 const RadarViewable* getFocus(); 57 RadarViewable::Shape addObjectDescription(const std::string name);57 RadarViewable::Shape addObjectDescription(const std::string& name); 58 58 59 59 void listObjects() const; -
code/branches/presentation2/src/orxonox/gamestates/GSLevel.cc
r6387 r6394 154 154 if (find == this->staticObjects_.end()) 155 155 { 156 COUT(3) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << ")"<< std::endl;156 COUT(3) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << ')' << std::endl; 157 157 } 158 158 } -
code/branches/presentation2/src/orxonox/gametypes/Asteroids.cc
r5929 r6394 72 72 Gametype::start(); 73 73 74 std::string message = "The match has started! Reach the first chekpoint within 15 seconds! But be aware, there may be pirates around...";74 std::string message("The match has started! Reach the first chekpoint within 15 seconds! But be aware, there may be pirates around..."); 75 75 COUT(0) << message << std::endl; 76 76 Host::Broadcast(message); … … 81 81 Gametype::end(); 82 82 83 std::string message = "The match has ended.";83 std::string message("The match has ended."); 84 84 COUT(0) << message << std::endl; 85 85 Host::Broadcast(message); -
code/branches/presentation2/src/orxonox/gametypes/Deathmatch.cc
r5781 r6394 47 47 Gametype::start(); 48 48 49 std::string message = "The match has started!";49 std::string message("The match has started!"); 50 50 COUT(0) << message << std::endl; 51 51 Host::Broadcast(message); … … 56 56 Gametype::end(); 57 57 58 std::string message = "The match has ended.";58 std::string message("The match has ended."); 59 59 COUT(0) << message << std::endl; 60 60 Host::Broadcast(message); … … 65 65 Gametype::playerEntered(player); 66 66 67 std::stringmessage = player->getName() + " entered the game";67 const std::string& message = player->getName() + " entered the game"; 68 68 COUT(0) << message << std::endl; 69 69 Host::Broadcast(message); … … 76 76 if (valid_player) 77 77 { 78 std::stringmessage = player->getName() + " left the game";78 const std::string& message = player->getName() + " left the game"; 79 79 COUT(0) << message << std::endl; 80 80 Host::Broadcast(message); … … 90 90 if (valid_player) 91 91 { 92 std::stringmessage = player->getOldName() + " changed name to " + player->getName();92 const std::string& message = player->getOldName() + " changed name to " + player->getName(); 93 93 COUT(0) << message << std::endl; 94 94 Host::Broadcast(message); … … 126 126 if (player) 127 127 { 128 std::stringmessage = player->getName() + " scores!";128 const std::string& message = player->getName() + " scores!"; 129 129 COUT(0) << message << std::endl; 130 130 Host::Broadcast(message); -
code/branches/presentation2/src/orxonox/gametypes/Gametype.cc
r6387 r6394 71 71 72 72 // load the corresponding score board 73 if (GameMode::showsGraphics() && this->scoreboardTemplate_ != "")73 if (GameMode::showsGraphics() && !this->scoreboardTemplate_.empty()) 74 74 { 75 75 this->scoreboard_ = new OverlayGroup(this); -
code/branches/presentation2/src/orxonox/gametypes/UnderAttack.cc
r5929 r6394 69 69 { 70 70 this->end(); //end gametype 71 std::string message = "Ship destroyed! Team 0 has won!";71 std::string message("Ship destroyed! Team 0 has won!"); 72 72 COUT(0) << message << std::endl; 73 73 Host::Broadcast(message); … … 152 152 this->gameEnded_ = true; 153 153 this->end(); 154 std::string message = "Time is up! Team 1 has won!";154 std::string message("Time is up! Team 1 has won!"); 155 155 COUT(0) << message << std::endl; 156 156 Host::Broadcast(message); … … 171 171 if ( gameTime_ <= timesequence_ && gameTime_ > 0) 172 172 { 173 std::stringmessage = multi_cast<std::string>(timesequence_) + " seconds left!";173 const std::string& message = multi_cast<std::string>(timesequence_) + " seconds left!"; 174 174 /* 175 175 COUT(0) << message << std::endl; -
code/branches/presentation2/src/orxonox/graphics/Billboard.cc
r5781 r6394 42 42 RegisterObject(Billboard); 43 43 44 this->material_ = "";45 44 this->colour_ = ColourValue::White; 46 45 // this->rotation_ = 0; … … 76 75 void Billboard::changedMaterial() 77 76 { 78 if (this->material_ == "")77 if (this->material_.empty()) 79 78 return; 80 79 … … 99 98 { 100 99 /* 101 if (this->getScene() && GameMode::showsGraphics() && (this->material_ != ""))100 if (this->getScene() && GameMode::showsGraphics() && !this->material_.empty()) 102 101 { 103 102 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); -
code/branches/presentation2/src/orxonox/infos/HumanPlayer.cc
r6108 r6394 164 164 if (this->isInitialized() && this->isLocalPlayer()) 165 165 { 166 if (this->getGametype() && this->getGametype()->getHUDTemplate() != "")166 if (this->getGametype() && !this->getGametype()->getHUDTemplate().empty()) 167 167 this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate()); 168 168 else … … 179 179 } 180 180 181 if (this->isLocalPlayer() && this->humanHudTemplate_ != ""&& GameMode::showsGraphics())181 if (this->isLocalPlayer() && !this->humanHudTemplate_.empty() && GameMode::showsGraphics()) 182 182 { 183 183 this->humanHud_ = new OverlayGroup(this); … … 195 195 } 196 196 197 if (this->isLocalPlayer() && this->gametypeHudTemplate_ != "")197 if (this->isLocalPlayer() && !this->gametypeHudTemplate_.empty()) 198 198 { 199 199 this->gametypeHud_ = new OverlayGroup(this); -
code/branches/presentation2/src/orxonox/items/Engine.h
r5929 r6394 106 106 virtual const Vector3& getDirection() const; 107 107 108 void loadSound(const std::string filename);109 110 108 private: 111 109 void networkcallback_shipID(); -
code/branches/presentation2/src/orxonox/items/MultiStateEngine.cc
r6381 r6394 35 35 36 36 #include "util/Convert.h" 37 #include "util/StringUtils.h"38 37 #include "core/CoreIncludes.h" 39 38 #include "core/GameMode.h" … … 201 200 if (effect == NULL) 202 201 return; 203 effect->setLuaState(this->lua_, "f"+ multi_cast<std::string>(this->effectContainers_.size()));202 effect->setLuaState(this->lua_, 'f' + multi_cast<std::string>(this->effectContainers_.size())); 204 203 this->effectContainers_.push_back(effect); 205 204 if (this->getShip()) -
code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc
r6375 r6394 318 318 this->print(this->shell_->getInput(), Shell::Input, 0); 319 319 320 if (this->shell_->getInput() == "" || this->shell_->getInput().size() == 0)320 if (this->shell_->getInput().empty()) 321 321 this->inputWindowStart_ = 0; 322 322 } -
code/branches/presentation2/src/orxonox/overlays/Map.cc
r6218 r6394 49 49 #include <OgreViewport.h> 50 50 51 #include "util/StringUtils.h" 51 52 #include "core/ConsoleCommand.h" 52 53 #include "core/CoreIncludes.h" -
code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc
r6387 r6394 45 45 #include "util/Convert.h" 46 46 #include "util/Exception.h" 47 #include "util/StringUtils.h"48 47 #include "core/GameMode.h" 49 48 #include "core/CoreIncludes.h" … … 146 145 147 146 if (OrxonoxOverlay::overlays_s.find(this->getName()) != OrxonoxOverlay::overlays_s.end()) 148 COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << "\""<< std::endl;147 COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << '"' << std::endl; 149 148 150 149 OrxonoxOverlay::overlays_s[this->getName()] = this; … … 154 153 void OrxonoxOverlay::setBackgroundMaterial(const std::string& material) 155 154 { 156 if (this->background_ && material != "")155 if (this->background_ && !material.empty()) 157 156 this->background_->setMaterialName(material); 158 157 } -
code/branches/presentation2/src/orxonox/pickup/DroppedItem.cc
r5929 r6394 83 83 if (this->item_) 84 84 { 85 COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'"<< std::endl;85 COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << '\'' << std::endl; 86 86 this->item_->destroy(); 87 87 } … … 112 112 drop->createTimer(); 113 113 114 COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << "," << position.y << ","<< position.z << ")." << std::endl;114 COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << ',' << position.y << ',' << position.z << ")." << std::endl; 115 115 116 116 return drop; -
code/branches/presentation2/src/orxonox/pickup/PickupInventory.cc
r6150 r6394 196 196 return ""; 197 197 198 std::stringname = "pickup_" + item->getGUIImage();198 const std::string& name = "pickup_" + item->getGUIImage(); 199 199 200 200 if(!CEGUI::ImagesetManager::getSingletonPtr()->isImagesetPresent(name)) … … 203 203 } 204 204 205 return "set:" + name + " image:full_image";205 return ("set:" + name + " image:full_image"); 206 206 } 207 207 … … 332 332 txt->setVisible(true); 333 333 txt->setProperty("Text", item->getGUIText()); 334 txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour + "");335 336 std::stringimage = PickupInventory::getImageForItem(item);334 txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour); 335 336 const std::string& image = PickupInventory::getImageForItem(item); 337 337 btn->setVisible(true); 338 338 btn->setProperty("NormalImage", image); -
code/branches/presentation2/src/orxonox/sound/AmbientSound.cc
r6388 r6394 113 113 if (GameMode::playsSound()) 114 114 { 115 std::string path = "ambient/" + MoodManager::getInstance().getMood() + "/"+ source;115 const std::string& path = "ambient/" + MoodManager::getInstance().getMood() + '/' + source; 116 116 shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path); 117 117 if (fileInfo != NULL) -
code/branches/presentation2/src/orxonox/sound/SoundBuffer.cc
r6378 r6394 57 57 DataStreamPtr dataStream = Resource::open(fileInfo); 58 58 59 std::string extension(this->filename_.substr(this->filename_.find_last_of('.') + 1));59 const std::string& extension = this->filename_.substr(this->filename_.find_last_of('.') + 1); 60 60 if (getLowercase(extension) == "ogg") 61 61 { -
code/branches/presentation2/src/orxonox/sound/SoundManager.cc
r6388 r6394 92 92 { 93 93 this->deviceNames_.push_back(devices); 94 COUT(4) << "\""<< devices << "\", ";94 COUT(4) << '"' << devices << "\", "; 95 95 devices += strlen(devices) + 1; 96 96 if (*devices == '\0') … … 100 100 101 101 // Open the selected device 102 COUT(3) << "Sound: Opening device \"" << renderDevice << "\""<< std::endl;102 COUT(3) << "Sound: Opening device \"" << renderDevice << '\' << std::endl; 103 103 this->device_ = alcOpenDevice(renderDevice.c_str()); 104 104 */ -
code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc
r6387 r6394 30 30 #include "WeaponMode.h" 31 31 32 #include "util/StringUtils.h"33 32 #include "core/CoreIncludes.h" 34 33 #include "core/XMLPort.h" -
code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc
r6387 r6394 333 333 this->camera_ = new Camera(this); 334 334 this->camera_->requestFocus(); 335 if ( this->cameraPositionTemplate_ != "")335 if (!this->cameraPositionTemplate_.empty()) 336 336 this->addTemplate(this->cameraPositionTemplate_); 337 337 if (this->cameraPositions_.size() > 0) … … 349 349 if (!this->hud_ && GameMode::showsGraphics()) 350 350 { 351 if ( this->hudtemplate_ != "")351 if (!this->hudtemplate_.empty()) 352 352 { 353 353 this->hud_ = new OverlayGroup(this); -
code/branches/presentation2/src/orxonox/worldentities/WorldEntity.cc
r6108 r6394 814 814 void WorldEntity::setCollisionTypeStr(const std::string& typeStr) 815 815 { 816 std::stringtypeStrLower = getLowercase(typeStr);816 const std::string& typeStrLower = getLowercase(typeStr); 817 817 CollisionType type; 818 818 if (typeStrLower == "dynamic") -
code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc
r6387 r6394 199 199 { 200 200 // play spawn effect 201 if ( this->spawnparticlesource_ != "")201 if (!this->spawnparticlesource_.empty()) 202 202 { 203 203 ParticleSpawner* effect = new ParticleSpawner(this->getCreator()); -
code/branches/presentation2/src/orxonox/worldentities/pawns/SpaceShip.cc
r5929 r6394 187 187 void SpaceShip::loadEngineTemplate() 188 188 { 189 if ( this->enginetemplate_ != "")189 if (!this->enginetemplate_.empty()) 190 190 { 191 191 Template* temp = Template::getTemplate(this->enginetemplate_);
Note: See TracChangeset
for help on using the changeset viewer.