Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (14 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/CommandEvaluation.cc

    r5781 r6417  
    5050        this->commandTokens_.split(command, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
    5151
    52         this->additionalParameter_ = "";
     52        this->additionalParameter_.clear();
    5353
    5454        this->bEvaluatedParams_ = false;
     
    6060        this->functionclass_ = 0;
    6161        this->function_ = 0;
    62         this->possibleArgument_ = "";
    63         this->argument_ = "";
    64 
    65         this->errorMessage_ = "";
     62        this->possibleArgument_.clear();
     63        this->argument_.clear();
     64
     65        this->errorMessage_.clear();
    6666        this->state_ = CommandState::Empty;
    6767    }
     
    7979        if (this->bEvaluatedParams_ && this->function_)
    8080        {
    81             COUT(6) << "CE_execute (evaluation): " << this->function_->getName() << " " << this->param_[0] << " " << this->param_[1] << " " << this->param_[2] << " " << this->param_[3] << " " << this->param_[4] << std::endl;
     81            COUT(6) << "CE_execute (evaluation): " << this->function_->getName() << ' ' << this->param_[0] << ' ' << this->param_[1] << ' ' << this->param_[2] << ' ' << this->param_[3] << ' ' << this->param_[4] << std::endl;
    8282            (*this->function_)(this->param_[0], this->param_[1], this->param_[2], this->param_[3], this->param_[4]);
    8383            return true;
     
    9898    }
    9999
    100     std::string CommandEvaluation::complete()
     100    const std::string& CommandEvaluation::complete()
    101101    {
    102102        if (!this->bNewCommand_)
     
    114114                            return (this->command_ = this->function_->getName());
    115115                        else
    116                             return (this->command_ = this->function_->getName() + " ");
     116                            return (this->command_ = this->function_->getName() + ' ');
    117117                    }
    118118                    else if (this->functionclass_)
    119                         return (this->command_ = this->functionclass_->getName() + " ");
     119                        return (this->command_ = this->functionclass_->getName() + ' ');
    120120                    break;
    121121                case CommandState::Function:
     
    123123                    {
    124124                        if (this->function_->getParamCount() == 0)
    125                             return (this->command_ = this->functionclass_->getName() + " " + this->function_->getName());
     125                            return (this->command_ = this->functionclass_->getName() + ' ' + this->function_->getName());
    126126                        else
    127                             return (this->command_ = this->functionclass_->getName() + " " + this->function_->getName() + " ");
     127                            return (this->command_ = this->functionclass_->getName() + ' ' + this->function_->getName() + ' ');
    128128                    }
    129129                    break;
     
    131131                case CommandState::Params:
    132132                {
    133                     if (this->argument_ == "" && this->possibleArgument_ == "")
     133                    if (this->argument_.empty() && this->possibleArgument_.empty())
    134134                        break;
    135135
     
    137137                    if (this->command_[this->command_.size() - 1] != ' ')
    138138                        maxIndex -= 1;
    139                     std::string whitespace = "";
    140 
    141                     if (this->possibleArgument_ != "")
     139                    std::string whitespace;
     140
     141                    if (!this->possibleArgument_.empty())
    142142                    {
    143143                        this->argument_ = this->possibleArgument_;
     
    146146                    }
    147147
    148                     return (this->command_ = this->commandTokens_.subSet(0, maxIndex).join() + " " + this->argument_ + whitespace);
     148                    return (this->command_ = this->commandTokens_.subSet(0, maxIndex).join() + ' ' + this->argument_ + whitespace);
    149149                    break;
    150150                }
     
    262262    std::string CommandEvaluation::dump(const std::list<std::pair<const std::string*, const std::string*> >& list)
    263263    {
    264         std::string output = "";
     264        std::string output;
    265265        for (std::list<std::pair<const std::string*, const std::string*> >::const_iterator it = list.begin(); it != list.end(); ++it)
    266266        {
    267267            if (it != list.begin())
    268                 output += " ";
    269 
    270             output += *(*it).second;
     268                output += ' ';
     269
     270            output += *(it->second);
    271271        }
    272272        return output;
     
    275275    std::string CommandEvaluation::dump(const ArgumentCompletionList& list)
    276276    {
    277         std::string output = "";
     277        std::string output;
    278278        for (ArgumentCompletionList::const_iterator it = list.begin(); it != list.end(); ++it)
    279279        {
    280280            if (it != list.begin())
    281                 output += " ";
    282 
    283             output += (*it).getDisplay();
     281                output += ' ';
     282
     283            output += it->getDisplay();
    284284        }
    285285        return output;
     
    295295        {
    296296            if (i != 0)
    297                 output += " ";
     297                output += ' ';
    298298
    299299            if (command->defaultValueSet(i))
    300                 output += "[";
     300                output += '[';
    301301            else
    302                 output += "{";
     302                output += '{';
    303303
    304304            output += command->getTypenameParam(i);
    305305
    306306            if (command->defaultValueSet(i))
    307                 output += "=" + command->getDefaultValue(i).getString() + "]";
     307                output += '=' + command->getDefaultValue(i).getString() + ']';
    308308            else
    309                 output += "}";
     309                output += '}';
    310310        }
    311311        return output;
Note: See TracChangeset for help on using the changeset viewer.