Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (14 years ago)
Author:
rgrieder
Message:

std::string tweaks:

  • Declared BLANKSTRING in UtilPrereqs.h as well (removed obsolete StringUtils.h includes to avoid dependencies)
  • Using BLANKSTRING if const std::string& return type is possible
  • Replaced a few (const) std::string arguments with const std::string&
  • if (str == "") —> if (str.empty())
  • std::string msg = name + "adsf"; —> const std::string& msg = name + "asdf";
  • std::string asdf = object→getFooBar(); —> const std::string& asdf = object→getFooBar();
  • std::string asdf = "asdf"; —> std::string asdf("asdf");
  • ostream << "."; and name + "." —> ostream << '.'; and name + '.'
  • str = ""; —> str.clear()
  • std::string asdf = ""; —> std::string asdf;
  • asdf_ = ""; (in c'tor) —> delete line
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/modules/questsystem/QuestDescription.cc

    r6387 r6394  
    5050    {
    5151        RegisterObject(QuestDescription);
    52 
    53         this->title_ = "";
    54         this->description_ = "";
    5552    }
    5653
     
    9491    bool QuestDescription::notificationHelper(const std::string & item, const std::string & status) const
    9592    {
    96         std::string message = "";
     93        std::string message;
    9794        if(item == "hint")
    9895        {
    99             message = "You received a hint: '" + this->title_ + "'";
     96            message = "You received a hint: '" + this->title_ + '\'';
    10097        }
    10198        else if(item == "quest")
     
    103100            if(status == "start")
    104101            {
    105                 message = "You received a new quest: '" + this->title_ + "'";
     102                message = "You received a new quest: '" + this->title_ + '\'';
    106103            }
    107104            else if(status == "fail")
    108105            {
    109                 message = "You failed the quest: '" + this->title_ + "'";
     106                message = "You failed the quest: '" + this->title_ + '\'';
    110107            }
    111108            else if(status == "complete")
    112109            {
    113                 message = "You successfully completed the quest: '" + this->title_ + "'";
     110                message = "You successfully completed the quest: '" + this->title_ + '\'';
    114111            }
    115112            else
Note: See TracChangeset for help on using the changeset viewer.