Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 9, 2010, 9:32:58 PM (15 years ago)
Author:
rgrieder
Message:

Removed excess white space at the end of lines.

Location:
code/branches/presentation3/src/orxonox
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/orxonox/ChatHistory.cc

    r6928 r7127  
    3939  /* constructor */
    4040#ifndef CHATTEST
    41   //ChatHistory::ChatHistory( BaseObject* creator ) : BaseObject(creator) 
    42   ChatHistory::ChatHistory() 
     41  //ChatHistory::ChatHistory( BaseObject* creator ) : BaseObject(creator)
     42  ChatHistory::ChatHistory()
    4343#else
    4444  ChatHistory::ChatHistory()
     
    6868  {
    6969    chat_hist_closelog();
    70    
     70
    7171    /* clear list */
    7272    this->hist_buffer.clear();
     
    7474
    7575  /* react to incoming chat */
    76   void ChatHistory::incomingChat(const std::string& message, 
     76  void ChatHistory::incomingChat(const std::string& message,
    7777    unsigned int senderID)
    7878  {
     
    104104    /* add the line to the log */
    105105    this->chat_hist_logline( text );
    106   } 
     106  }
    107107
    108108  /* Synchronize logfile onto the hard drive */ /* MARK MARK */
     
    128128  /* log a line to a logfile */
    129129  int ChatHistory::chat_hist_logline( const std::string& toadd )
    130   { 
     130  {
    131131    /* output the line to the file if logging is enabled */
    132132    if( this->hist_log_enabled )
     
    138138  int ChatHistory::chat_hist_openlog()
    139139  {
    140     /* TODO: find out the name of the file to log to via settings 
     140    /* TODO: find out the name of the file to log to via settings
    141141     *       and set the this->hist_logfile_path variable to it
    142142     */
     
    167167    /* see if we've actually got a logfile */
    168168    if( this->hist_logfile )
    169     { 
     169    {
    170170      /* yes, we've got one, add a line that shows we're closing it */
    171171      this->chat_hist_logline( "--- Logfile closed ---" );
  • code/branches/presentation3/src/orxonox/ChatHistory.h

    r6928 r7127  
    3434
    3535/* define this if you're unit testing */
    36 //#define CHATTEST 
     36//#define CHATTEST
    3737
    3838#ifndef CHATTEST
     
    6262
    6363#else
    64   class ChatHistory 
     64  class ChatHistory
    6565#endif
    6666  {
     
    7575      virtual ~ChatHistory();
    7676
    77  
     77
    7878    //protected:
    79       /** what to do with incoming chat 
    80        * 
    81        * \param message The incoming message 
     79      /** what to do with incoming chat
     80       *
     81       * \param message The incoming message
    8282       * \param senderID Identification number of the sender
    8383       */
    84       virtual void incomingChat(const std::string& message, 
     84      virtual void incomingChat(const std::string& message,
    8585        unsigned int senderID);
    86      
    87       /** Synchronize logfile onto the hard drive 
     86
     87      /** Synchronize logfile onto the hard drive
    8888       *
    8989       * \return 0 for success, other for error
     
    9393      /** debug-print: output the whole history to stdout */
    9494      void debug_printhist();
    95      
     95
    9696    private:
    9797      /* FIELDS */
  • code/branches/presentation3/src/orxonox/ChatInputHandler.cc

    r7049 r7127  
    4040#include <string>
    4141
    42 namespace orxonox 
     42namespace orxonox
    4343{
    4444  /* singleton */
     
    4848  SetConsoleCommandAlias( ChatInputHandler, activate_static, "startchat",
    4949    true );
    50   SetConsoleCommandAlias( ChatInputHandler, activate_small_static, 
     50  SetConsoleCommandAlias( ChatInputHandler, activate_small_static,
    5151    "startchat_small", true );
    5252
     
    111111
    112112    /* cast it to a listbox */
    113     lb_history = dynamic_cast<CEGUI::Listbox*>(history); 
     113    lb_history = dynamic_cast<CEGUI::Listbox*>(history);
    114114
    115115    /* assert wee */
     
    140140    }
    141141
    142     // blues 
     142    // blues
    143143    red = 0.5, green = 0.5, blue = 1;
    144144    for( ; i < NumberOfColors; ++i )
     
    171171  }
    172172
    173   void ChatInputHandler::deactivate() 
     173  void ChatInputHandler::deactivate()
    174174  {
    175175    /* stop listening */
     
    202202
    203203  /* handle incoming chat */
    204   void ChatInputHandler::incomingChat(const std::string& message, 
     204  void ChatInputHandler::incomingChat(const std::string& message,
    205205    unsigned int senderID)
    206206  {
     
    210210    /* setup player name info */
    211211    if (senderID != CLIENTID_UNKNOWN)
    212     { 
     212    {
    213213       PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    214214       if (player)
     
    227227    /* now add */
    228228    this->lb_history->addItem( dynamic_cast<CEGUI::ListboxItem*>(toadd) );
    229     this->lb_history->ensureItemIsVisible( 
     229    this->lb_history->ensureItemIsVisible(
    230230      dynamic_cast<CEGUI::ListboxItem*>(toadd) );
    231231
    232232    /* make sure the history handles it */
    233233    this->lb_history->handleUpdatedItemData();
    234   } 
     234  }
    235235
    236236
    237237  /* sub for inputchanged */
    238   void ChatInputHandler::sub_adjust_dispoffset( int maxlen, 
    239     int cursorpos, 
     238  void ChatInputHandler::sub_adjust_dispoffset( int maxlen,
     239    int cursorpos,
    240240    int inplen )
    241241  {
    242242    /* already start offsetting 5 characters before end */
    243243    if( cursorpos+5 > maxlen )
    244     { 
     244    {
    245245      /* always stay 5 characters ahead of end, looks better */
    246246      ((disp_offset = cursorpos-maxlen+5) >= 0) ? 1 : disp_offset = 0;
     
    249249      (disp_offset > cursorpos ) ? disp_offset = 0 : 1;
    250250    }
    251      
     251
    252252    /* make sure we don't die at substr */
    253253    if( inplen <= disp_offset ) disp_offset = 0;
     
    260260    std::string raw = this->inpbuf->get();
    261261    int cursorpos = this->inpbuf->getCursorPosition();
    262    
     262
    263263    /* get string before cursor */
    264264    std::string left = raw.substr( 0, cursorpos );
     
    268268    if( raw.length() >= left.length()+1 )
    269269      right = raw.substr( cursorpos );
    270      
     270
    271271    /* set the text */
    272272    std::string assembled = "$ " + left + "|" + right;
    273273
    274274    if( this->fullchat )
    275     { 
     275    {
    276276      /* adjust curser position - magic number 5 for font width */
    277       sub_adjust_dispoffset( (this->input->getUnclippedInnerRect().getWidth()/6), 
     277      sub_adjust_dispoffset( (this->input->getUnclippedInnerRect().getWidth()/6),
    278278        cursorpos, assembled.length() );
    279279      this->input->setProperty( "Text", assembled.substr( disp_offset ) );
     
    282282    {
    283283      /* adjust curser position - magic number 5 for font width */
    284       sub_adjust_dispoffset( (this->inputonly->getUnclippedInnerRect().getWidth()/6), 
     284      sub_adjust_dispoffset( (this->inputonly->getUnclippedInnerRect().getWidth()/6),
    285285        cursorpos, assembled.length() );
    286286      this->inputonly->setProperty( "Text", assembled.substr( disp_offset) );
     
    323323  void ChatInputHandler::cursorRight()
    324324  { this->inpbuf->increaseCursor(); }
    325  
     325
    326326  void ChatInputHandler::cursorLeft()
    327327  { this->inpbuf->decreaseCursor(); }
    328  
     328
    329329  void ChatInputHandler::cursorEnd()
    330330  { this->inpbuf->setCursorToEnd(); }
  • code/branches/presentation3/src/orxonox/ChatInputHandler.h

    r7043 r7127  
    6262    private:
    6363      /** Input buffer, to be used to catch input from the
    64        * keyboard 
     64       * keyboard
    6565       */
    6666      InputBuffer *inpbuf;
     
    126126       * history window of the full chat window)
    127127       */
    128       void incomingChat( const std::string& message, 
     128      void incomingChat( const std::string& message,
    129129        unsigned int senderID );
    130130
    131131      /** \param full true means show full chat window with history,
    132132            false means show only an input line
    133        * 
    134        * Show the chat window and redirect the game's keyboard input 
     133       *
     134       * Show the chat window and redirect the game's keyboard input
    135135       * into it.
    136136       */
  • code/branches/presentation3/src/orxonox/Level.cc

    r7105 r7127  
    4949        RegisterObject(Level);
    5050
    51        
     51
    5252        this->registerVariables();
    5353        this->xmlfilename_ = this->getFilename();
     
    7373        XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode);
    7474        XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
    75            
     75
    7676        XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
    7777        XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
     
    9999        Loader::open(this->xmlfile_);
    100100    }
    101    
     101
    102102    void Level::networkCallbackTemplatesChanged()
    103103    {
     
    151151        return 0;
    152152    }
    153    
     153
    154154    void Level::addLodInfo(MeshLodInformation* lodInformation)
    155155    {
     
    165165        if(this->lodInformation_.find(meshName)!=this->lodInformation_.end())
    166166            return this->lodInformation_.find(meshName)->second;
    167        
     167
    168168        return 0;
    169169    }
  • code/branches/presentation3/src/orxonox/MoodManager.cc

    r7121 r7127  
    4545        RegisterRootObject(MoodManager);
    4646        this->setConfigValues();
    47        
     47
    4848        // Checking for the existence of the folder for the default mood
    4949        /* Note: Currently Resource::exists(path) will always return false when the path field points to a folder.
  • code/branches/presentation3/src/orxonox/OrxonoxPrereqs.h

    r7034 r7127  
    137137    class OrxonoxOverlay;
    138138    class OverlayGroup;
    139    
     139
    140140    // pickup
    141141    class PickupIdentifier;
  • code/branches/presentation3/src/orxonox/Radar.cc

    r6942 r7127  
    8787        }
    8888    }
    89    
     89
    9090    void Radar::removeRadarObject(RadarViewable* rv)
    9191    {
     
    203203        }
    204204    }
    205    
     205
    206206    void Radar::radarObjectChanged(RadarViewable* rv)
    207207    {
  • code/branches/presentation3/src/orxonox/controllers/AIController.cc

    r7090 r7127  
    112112            random = rnd(maxrand);
    113113            if (random < 25 && (this->bShooting_))
    114                 this->bShooting_ = false; 
     114                this->bShooting_ = false;
    115115
    116116        }
     
    127127            this->commandSlaves();
    128128
    129             if  (this->specificMasterAction_ != NONE) 
     129            if  (this->specificMasterAction_ != NONE)
    130130                    this->specificMasterActionHold();
    131131
     
    149149                 // lose master status (only if less than 4 slaves in formation)
    150150                random = rnd(maxrand);
    151                 if(random < 15/(this->slaves_.size()+1) && this->slaves_.size() < 4 ) 
     151                if(random < 15/(this->slaves_.size()+1) && this->slaves_.size() < 4 )
    152152                   this->loseMasterState();
    153153
  • code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc

    r7107 r7127  
    9191        {
    9292            this->removeFromFormation();
    93            
     93
    9494            for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it; ++it)
    9595            {
     
    101101                        it->myMaster_ = 0;
    102102                    }
    103                    
     103
    104104                    while (true)
    105105                    {
     
    139139        {
    140140            Controller* controller = 0;
    141            
     141
    142142            if (it->getController())
    143143                controller = it->getController();
    144144            else if (it->getXMLController())
    145145                controller = it->getXMLController();
    146                
     146
    147147            if (!controller)
    148148                continue;
     
    162162
    163163    /**
    164         @brief Get all masters to do a "specific master action" 
     164        @brief Get all masters to do a "specific master action"
    165165        @param action which action to perform (integer, so it can be called with a console command (tmp solution))
    166166    */
     
    170170        {
    171171            Controller* controller = 0;
    172            
     172
    173173            if (it->getController())
    174174                controller = it->getController();
    175175            else if (it->getXMLController())
    176176                controller = it->getXMLController();
    177                
     177
    178178            if (!controller)
    179179                continue;
     
    204204        {
    205205            Controller* controller = 0;
    206            
     206
    207207            if (it->getController())
    208208                controller = it->getController();
    209209            else if (it->getXMLController())
    210210                controller = it->getXMLController();
    211                
     211
    212212            if (!controller)
    213213                continue;
     
    252252        {
    253253            Controller* controller = 0;
    254            
     254
    255255            if (it->getController())
    256256                controller = it->getController();
    257257            else if (it->getXMLController())
    258258                controller = it->getXMLController();
    259                
     259
    260260            if (!controller)
    261261                continue;
     
    280280        {
    281281            Controller* controller = 0;
    282            
     282
    283283            if (it->getController())
    284284                controller = it->getController();
    285285            else if (it->getXMLController())
    286286                controller = it->getXMLController();
    287                
     287
    288288            if (!controller)
    289289                continue;
     
    303303    void ArtificialController::changedControllableEntity()
    304304    {
    305         if (!this->getControllableEntity()) 
     305        if (!this->getControllableEntity())
    306306            this->removeFromFormation();
    307307    }
     
    400400                this->myMaster_->slaves_.erase(it);
    401401        }
    402        
     402
    403403        this->myMaster_ = 0;
    404404        this->state_ = FREE;
     
    423423            //has it an ArtificialController?
    424424            Controller* controller = 0;
    425            
     425
    426426            if (it->getController())
    427427                controller = it->getController();
    428428            else if (it->getXMLController())
    429429                controller = it->getXMLController();
    430                
     430
    431431            if (!controller)
    432432                continue;
     
    476476        @brief Commands the slaves of a master into a formation. Sufficiently fast not to be called within tick. Initiated by a master.
    477477    */
    478     void ArtificialController::commandSlaves() 
     478    void ArtificialController::commandSlaves()
    479479    {
    480480        if(this->state_ != MASTER) return;
     
    489489            this->slaves_.front()->setTargetPosition(dest);
    490490        }
    491         else 
     491        else
    492492        {
    493493            dest += 1.0f*orient*WorldEntity::BACK;
     
    592592    bool ArtificialController::forcedFree()
    593593    {
    594         if(this->freedomCount_ > 0) 
     594        if(this->freedomCount_ > 0)
    595595        {
    596596            this->freedomCount_--;
     
    606606        if(this->state_ != MASTER) return;
    607607
    608         if (specificMasterActionHoldCount_ == 0) 
     608        if (specificMasterActionHoldCount_ == 0)
    609609         {
    610610            this->specificMasterAction_ = NONE;
     
    677677        if (!always)
    678678            this->specificMasterActionHoldCount_ = secondsToFollow;
    679         else 
     679        else
    680680            this->specificMasterActionHoldCount_ = INT_MAX; //for now...
    681681
     
    698698
    699699            currentHumanController = orxonox_cast<NewHumanController*>(it->getController());
    700             if(currentHumanController) 
     700            if(currentHumanController)
    701701            {
    702702                if (!ArtificialController::sameTeam(this->getControllableEntity(), *it, this->getGametype())) continue;
  • code/branches/presentation3/src/orxonox/controllers/ArtificialController.h

    r7107 r7127  
    6464            inline int getFormationSize() const
    6565                { return this->maxFormationSize_; }
    66                
     66
    6767            inline void setPassive(bool passive)
    6868                { this->passive_ = passive; }
  • code/branches/presentation3/src/orxonox/controllers/DroneController.h

    r7034 r7127  
    5252            DroneController(BaseObject* creator);
    5353            virtual ~DroneController();
    54            
     54
    5555            virtual void tick(float dt); //!< The controlling happens here. This method defines what the controller has to do each tick.
    5656
  • code/branches/presentation3/src/orxonox/gametypes/Gametype.cc

    r6996 r7127  
    330330                if (index == randomspawn)
    331331                    return (*it);
    332                
     332
    333333                ++index;
    334334            }
  • code/branches/presentation3/src/orxonox/graphics/MeshLodInformation.cc

    r7039 r7127  
    4040    CreateFactory(MeshLodInformation);
    4141
    42     MeshLodInformation::MeshLodInformation(BaseObject* creator) 
     42    MeshLodInformation::MeshLodInformation(BaseObject* creator)
    4343    : BaseObject(creator), lodLevel_(5), bEnabled_(true), numLevels_(10), reductionRate_(0.15)
    4444    {
     
    5959        XMLPortParam(MeshLodInformation, "reductionRate", setReductionRate, getReductionRate, xmlelement, mode);
    6060    }
    61    
     61
    6262    std::string MeshLodInformation::getMeshName()
    6363    {
    6464        return MeshLodInformation::getMeshSource();
    6565    }
    66    
     66
    6767    void MeshLodInformation::setLodLevel(float lodLevel)
    6868    {
     
    7373    {
    7474        return lodLevel_;
    75     } 
     75    }
    7676    void MeshLodInformation::setMeshSource(std::string meshSource)
    7777    {
     
    8282        return meshSource_;
    8383    }
    84  
     84
    8585}
  • code/branches/presentation3/src/orxonox/graphics/MeshLodInformation.h

    r7036 r7127  
    4343            MeshLodInformation(BaseObject* creator);
    4444            virtual ~MeshLodInformation();
    45            
     45
    4646            float getLodLevel();
    4747            std::string getMeshName();
     
    4949            unsigned int getNumLevels(){ return this->numLevels_; }
    5050            float getReductionRate(){ return this->reductionRate_; }
    51            
     51
    5252            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5353
  • code/branches/presentation3/src/orxonox/graphics/Model.cc

    r7111 r7127  
    4242    CreateFactory(Model);
    4343
    44     Model::Model(BaseObject* creator) : 
     44    Model::Model(BaseObject* creator) :
    4545        StaticEntity(creator), bCastShadows_(true), lodLevel_(5), bLodEnabled_(true), numLodLevels_(10), lodReductionRate_(.15)
    4646    {
     
    5959    {
    6060        SUPER(Model, XMLPort, xmlelement, mode);
    61        
     61
    6262        XMLPortParam(Model, "lodLevel", setLodLevel, getLodLevel, xmlelement, mode);
    63        
     63
    6464        XMLPortParam(Model, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    6565        XMLPortParam(Model, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     
    8181        return scaleFactor;
    8282    }
    83    
     83
    8484    void Model::changedMesh()
    8585    {
     
    8888            if (this->mesh_.getEntity())
    8989                this->detachOgreObject(this->mesh_.getEntity());
    90            
     90
    9191            this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
    9292
     
    9696                this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
    9797                this->mesh_.setVisible(this->isVisible());
    98                
    99                
     98
     99
    100100                //LOD
    101101                if( this->mesh_.getEntity()->getMesh()->getNumLodLevels()==1 )
    102102                {
    103103                    Level* level = this->getLevel();
    104                  
     104
    105105                    assert( level != 0 );
    106                    
     106
    107107                    MeshLodInformation* lodInfo = level->getLodInfo(this->meshSrc_);
    108108                    if( lodInfo )
     
    122122                        float volume = this->mesh_.getEntity()->getBoundingBox().volume();
    123123    //                     float scaleFactor = 1;
    124                        
     124
    125125    //                     BaseObject* creatorPtr = this;
    126     //                     
     126    //
    127127    //                     while(creatorPtr!=NULL&&orxonox_cast<WorldEntity*>(creatorPtr))
    128128    //                     {
     
    131131    //                     }
    132132    //                     COUT(0) << "name: " << this->meshSrc_ << "scaleFactor: " << scaleFactor << ", volume: " << volume << endl;
    133                        
     133
    134134                        COUT(4) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << std::endl;
    135135
     
    144144    //                         float factor = scaleFactor*5/lodLevel_;
    145145                            float factor = pow(volume, 2.0f / 3.0f) * 15.0f / lodLevel_;
    146                            
     146
    147147                            COUT(4) << "LodLevel set with factor: " << factor << endl;
    148148
     
    160160                                distList.pop_back();
    161161
    162                            
     162
    163163                            //Generiert LOD-Levels
    164164                            this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, this->lodReductionRate_);
     
    171171                            else
    172172                                what = "<0";
    173                            
     173
    174174                            COUT(4)<<"LodLevel not set because lodLevel("<<lodLevel_<<") was "<<what<<"." << endl;
    175175                        }
  • code/branches/presentation3/src/orxonox/graphics/Model.h

    r7036 r7127  
    6161            inline bool getCastShadows() const
    6262                { return this->bCastShadows_; }
    63                
     63
    6464        protected:
    6565            void changedMesh();
    6666            void changedShadows();
    67            
     67
    6868            //LoD
    6969            inline void setLodLevel(float lodLevel)
     
    7676            Mesh mesh_;
    7777            bool bCastShadows_;
    78            
     78
    7979            //LoD
    8080            float lodLevel_;
     
    8282            unsigned int numLodLevels_;
    8383            float lodReductionRate_;
    84            
     84
    8585    };
    8686}
  • code/branches/presentation3/src/orxonox/infos/GametypeInfo.cc

    r7062 r7127  
    157157            it->staticmessage(this, message, colour);
    158158    }
    159    
     159
    160160     void GametypeInfo::dispatchFadingMessage(const std::string& message)
    161161    {
  • code/branches/presentation3/src/orxonox/interfaces/InterfaceCompilation.cc

    r7096 r7127  
    5252        RegisterRootObject(GametypeMessageListener);
    5353    }
    54    
     54
    5555    //----------------------------
    5656    // PickupCarrier
     
    5959    {
    6060        RegisterRootObject(PickupCarrier);
    61        
     61
    6262        this->setCarrierName("PickupCarrier");
    6363    }
    64    
     64
    6565    PickupCarrier::~PickupCarrier()
    6666    {
     
    8585        this->isForPlayer_ = true;
    8686    }
    87    
     87
    8888    //----------------------------
    8989    // RadarListener
  • code/branches/presentation3/src/orxonox/interfaces/PickupCarrier.h

    r7034 r7127  
    6868        friend class Pickupable;
    6969        friend class PickupManager;
    70         //! Friends. 
     70        //! Friends.
    7171        friend class Pickup;
    7272        friend class HealthPickup;
     
    170170            */
    171171            virtual const Vector3& getCarrierPosition(void) = 0;
    172            
     172
    173173            /**
    174174            @brief Get the name of this PickupCarrier.
     
    176176            */
    177177            const std::string& getCarrierName(void) { return this->carrierName_; } // tolua_export
    178            
    179         protected:       
     178
     179        protected:
    180180            /**
    181181            @brief Get all direct children of this PickupSpawner.
     
    198198            std::set<Pickupable*>& getPickups(void)
    199199                { return this->pickups_; }
    200                
     200
    201201            /**
    202202            @brief Set the name of this PickupCarrier.
     
    206206            void setCarrierName(const std::string& name)
    207207                { this->carrierName_ = name; }
    208        
     208
    209209        private:
    210210            std::set<Pickupable*> pickups_; //!< The list of Pickupables carried by this PickupCarrier.
    211211            std::string carrierName_; //!< The name of the PickupCarrier, as displayed in the PickupInventory.
    212            
     212
    213213            /**
    214214            @brief Get the number of carrier children this PickupCarrier has.
     
    222222                    return size;
    223223                }
    224            
     224
    225225            /**
    226226            @brief Get the index-th child of this PickupCarrier.
     
    237237                    return carrier;
    238238                }
    239            
     239
    240240            /**
    241241            @brief Get the number of Pickupables this PickupCarrier carries.
     
    244244            unsigned int getNumPickups(void)
    245245                { return this->pickups_.size(); }
    246            
     246
    247247            /**
    248248            @brief Get the index-th Pickupable of this PickupCarrier.
     
    259259                    return *it;
    260260                }
    261            
     261
    262262    };
    263263}
  • code/branches/presentation3/src/orxonox/interfaces/Pickupable.cc

    r7094 r7127  
    4646namespace orxonox
    4747{
    48    
     48
    4949    /**
    5050    @brief
     
    5252    */
    5353    Pickupable::Pickupable() : pickupIdentifier_(NULL), used_(false), pickedUp_(false)
    54     {       
     54    {
    5555        RegisterRootObject(Pickupable);
    56        
     56
    5757        this->carrier_ = NULL;
    58        
     58
    5959        this->pickupIdentifier_ = new PickupIdentifier(this);
    6060    }
    61    
    62     /**
    63     @brief
    64         Destructor. 
     61
     62    /**
     63    @brief
     64        Destructor.
    6565    */
    6666    Pickupable::~Pickupable()
     
    6868        if(this->isUsed())
    6969            this->setUsed(false);
    70        
     70
    7171        if(this->isPickedUp() && this->getCarrier() != NULL)
    7272        {
     
    7474            this->setCarrier(NULL);
    7575        }
    76        
     76
    7777        if(this->pickupIdentifier_ != NULL)
    7878            this->pickupIdentifier_->destroy();
    7979    }
    80    
     80
    8181    /**
    8282    @brief
     
    9191        if(this->used_ == used)
    9292            return false;
    93        
     93
    9494        COUT(4) << "Pickupable (&" << this << ") set to used " << used << "." << std::endl;
    95        
     95
    9696        this->used_ = used;
    9797        this->changedUsed();
     
    100100        return true;
    101101    }
    102    
     102
    103103    /**
    104104    @brief
     
    115115        return this->isTarget(carrier->getIdentifier());
    116116    }
    117    
     117
    118118    /**
    119119    @brief
     
    134134        return false;
    135135    }
    136        
     136
    137137    /**
    138138    @brief
     
    147147        return this->addTarget(target->getIdentifier());
    148148    }
    149    
     149
    150150    /**
    151151    @brief
     
    160160        if(this->isTarget(target)) //!< If the input target is already present in the list of targets.
    161161            return false;
    162        
     162
    163163        COUT(4) << "Target " << target->getName() << " added to Pickupable (&" << this << ")." << std::endl;
    164164        this->targets_.push_back(target);
    165165        return true;
    166166    }
    167    
    168     /**
    169     @brief 
     167
     168    /**
     169    @brief
    170170        Sets the Pickupable to picked up.
    171171        This method will be called by the PickupCarrier picking the Pickupable up.
     
    179179        if(this->isPickedUp()) //!< If the Pickupable is already picked up.
    180180            return false;
    181        
     181
    182182        COUT(4) << "Pickupable (&" << this << ") got picked up by a PickupCarrier (&" << carrier << ")." << std::endl;
    183183        this->setCarrier(carrier);
     
    185185        return true;
    186186    }
    187    
     187
    188188    /**
    189189    @brief
     
    198198        if(this->pickedUp_ == pickedUp)
    199199            return false;
    200        
     200
    201201        COUT(4) << "Pickupable (&" << this << ") set to pickedUp " << pickedUp << "." << std::endl;
    202        
     202
    203203        this->pickedUp_ = pickedUp;
    204204        this->changedPickedUp();
     
    206206        return true;
    207207    }
    208        
     208
    209209    /**
    210210    @brief
     
    217217        if(this->carrier_ == carrier)
    218218            return false;
    219        
     219
    220220        COUT(4) << "Pickupable (&" << this << ") changed Carrier (& " << carrier << ")." << std::endl;
    221        
     221
    222222        this->carrier_ = carrier;
    223223        this->changedCarrier();
     
    226226        return true;
    227227    }
    228    
    229     /**
    230     @brief 
     228
     229    /**
     230    @brief
    231231        Sets the Pickupable to not picked up or dropped.
    232232        This method will be called by the PickupCarrier dropping the Pickupable.
     
    238238        if(!this->isPickedUp()) //!< If the Pickupable is not picked up.
    239239            return false;
    240        
     240
    241241        COUT(4) << "Pickupable (&" << this << ") got dropped up by a PickupCarrier (&" << this->getCarrier() << ")." << std::endl;
    242242        this->setUsed(false);
    243243        this->setPickedUp(false);
    244        
     244
    245245        bool created = this->createSpawner();
    246        
     246
    247247        this->setCarrier(NULL);
    248        
     248
    249249        if(!created)
    250250        {
    251251            this->destroy();
    252252        }
    253        
    254         return true;
    255     }
    256    
     253
     254        return true;
     255    }
     256
    257257    /**
    258258    @brief
     
    265265        OrxonoxClass* item = NULL;
    266266        this->clone(item);
    267        
     267
    268268        Pickupable* pickup = dynamic_cast<Pickupable*>(item);
    269        
     269
    270270        COUT(4) << "Pickupable (&" << this << ") cloned. Clone is new Pickupable (&" << pickup << ")." << std::endl;
    271271        return pickup;
    272272    }
    273    
     273
    274274    /**
    275275    @brief
     
    299299        return carrier->pickup(this);
    300300    }
    301    
     301
    302302}
  • code/branches/presentation3/src/orxonox/interfaces/Pickupable.h

    r7094 r7127  
    4545namespace orxonox // tolua_export
    4646{ // tolua_export
    47    
     47
    4848    /**
    4949    @brief
     
    5757        protected:
    5858            Pickupable(); //!< Default constructor.
    59        
     59
    6060        public:
    6161            virtual ~Pickupable(); //!< Default destructor.
    62            
     62
    6363            /**
    6464            @brief Get whether the pickup is currently in use or not.
     
    7171            */
    7272            virtual void changedUsed(void) {}
    73            
     73
    7474            /**
    7575            @brief Get the carrier of the pickup.
     
    8383            */
    8484            virtual void changedCarrier(void) {}
    85            
     85
    8686            /**
    8787            @brief Returns whether the Pickupable is currently picked up.
     
    9494            */
    9595            virtual void changedPickedUp(void) {}
    96            
     96
    9797            bool pickedUp(PickupCarrier* carrier); //!< Sets the Pickupable to picked up.
    9898            bool dropped(void); //!< Sets the Pickupable to not picked up or dropped.
    99            
     99
    100100            virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
    101101            bool isTarget(const Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
    102102            bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
    103103            bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this pickup.
    104            
     104
    105105            Pickupable* clone(void); //!< Creates a duplicate of the Pickupable.
    106106            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    107            
     107
    108108            /**
    109109            @brief Get the PickupIdentifier of this Pickupable.
     
    112112            virtual const PickupIdentifier* getPickupIdentifier(void)
    113113                { return this->pickupIdentifier_; }
    114                
     114
    115115            bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
    116116            bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
    117117            bool setCarrier(PickupCarrier* carrier, bool tell = false); //!< Sets the carrier of the pickup.
    118            
     118
    119119        protected:
    120120            /**
     
    122122            */
    123123            void initializeIdentifier(void) {}
    124            
     124
    125125            /**
    126126            @brief Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
     
    131131            */
    132132            virtual bool createSpawner(void) = 0;
    133            
     133
    134134            PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
    135            
     135
    136136        private:
    137            
     137
    138138            bool used_; //!< Whether the pickup is currently in use or not.
    139139            bool pickedUp_; //!< Whether the pickup is currently picked up or not.
    140            
     140
    141141            PickupCarrier* carrier_; //!< The carrier of the pickup.
    142142            std::list<Identifier*> targets_; //!< The possible targets of this pickup.
     
    147147
    148148    };  // tolua_export
    149    
     149
    150150    SUPER_FUNCTION(10, Pickupable, changedUsed, false);
    151151    SUPER_FUNCTION(12, Pickupable, changedCarrier, false);
  • code/branches/presentation3/src/orxonox/interfaces/RadarViewable.cc

    r7045 r7127  
    6565    RadarViewable::~RadarViewable()
    6666    {
    67        
     67
    6868        if( this->bInitialized_ )
    6969        {
     
    109109        }
    110110    }
    111    
     111
    112112    void RadarViewable::settingsChanged()
    113113    {
  • code/branches/presentation3/src/orxonox/interfaces/RadarViewable.h

    r7045 r7127  
    8888
    8989        inline void setRadarVisibility(bool b)
    90             { 
     90            {
    9191                if(b!=this->bVisibility_)
    9292                {
  • code/branches/presentation3/src/orxonox/pickup/PickupIdentifier.cc

    r6725 r7127  
    3939namespace orxonox
    4040{
    41    
     41
    4242    /**
    4343    @brief
     
    4747    {
    4848        RegisterRootObject(PickupIdentifier);
    49        
     49
    5050        if(pickup == NULL)
    5151            COUT(1) << "Error, PickupIdentifier was created without a valid Pickupable." << std::endl;
    52        
     52
    5353        this->pickup_ = pickup;
    5454    }
    55    
     55
    5656    PickupIdentifier::~PickupIdentifier()
    5757    {
    5858
    5959    }
    60    
     60
    6161    /**
    6262    @brief
     
    7474            COUT(1) << "Error in PickupIdentifier::compare: Input Identifier is NULL." << std::endl;
    7575        }
    76        
     76
    7777        if(identifier->pickup_ == NULL && this->pickup_ == NULL)
    7878        {
     
    8080            COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl;
    8181        }
    82        
     82
    8383        if(identifier->pickup_ == NULL)
    8484        {
     
    8686            COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl;
    8787        }
    88        
     88
    8989        if(this->pickup_ == NULL)
    9090        {
     
    9292            COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl;
    9393        }
    94        
     94
    9595        //! If the classIdentifiers are not the same (meaning the PickupIdentifiers identify different classes), the obviously the two Pickupables identified by the PickupIdentifiers cannot be the same. An ordering is established through the alphabetical ordering of the respective classnames.
    9696        if(!identifier->pickup_->getIdentifier()->isExactlyA(this->pickup_->getIdentifier()))
    9797            return this->pickup_->getIdentifier()->getName().compare(identifier->pickup_->getIdentifier()->getName());
    98        
     98
    9999        //! If the class is the same for both PickupIdentifiers we go on to check the parameters of the class.
    100100        //! If the two have a different number of parameters then obviusly something is very wrong.
     
    104104            return this->parameters_.size()-identifier->parameters_.size();
    105105        }
    106        
     106
    107107        //! We iterate through all parameters and compar their values (which are strings). The first parameter is the most significant. The ordering is once again established by the alphabetical comparison of the two value strings.
    108108        for(std::map<std::string, std::string>::const_iterator it = this->parameters_.begin(); it != this->parameters_.end(); it++)
     
    117117                return it->second.compare(identifier->parameters_.find(it->first)->second);
    118118        }
    119            
     119
    120120        return 0;
    121121    }
    122    
     122
    123123    /**
    124124    @brief
     
    134134    {
    135135        COUT(4) << "PickupIdentifier " << name << ", " << value << std::endl;
    136        
     136
    137137        if(!(this->parameters_.find(name) == this->parameters_.end()))
    138138        {
     
    140140            return false;
    141141        }
    142        
     142
    143143        this->parameters_[name] = value;
    144        
     144
    145145        return true;
    146146    }
    147    
     147
    148148}
  • code/branches/presentation3/src/orxonox/pickup/PickupIdentifier.h

    r6540 r7127  
    4141#include "core/Identifier.h"
    4242
    43 #include "core/OrxonoxClass.h" 
     43#include "core/OrxonoxClass.h"
    4444
    4545namespace orxonox
    4646{
    47    
     47
    4848    /**
    4949    @brief
     
    5757    class _OrxonoxExport PickupIdentifier : virtual public OrxonoxClass
    5858    {
    59        
     59
    6060        public:
    6161            PickupIdentifier(Pickupable* pickup); //!< Constructor.
    6262            ~PickupIdentifier(); //!< Destructor.
    63            
     63
    6464            virtual int compare(const PickupIdentifier* identifier) const; //!< Compares two PickupIdentifiers and returns 0 if a == b, <0 if a < b and >0 if a > b for a.compare(b).
    65            
     65
    6666            bool addParameter(std::string & name, std::string & value); //!< Add a parameter to the PickupIdentifier.
    67            
     67
    6868        private:
    6969            Pickupable* pickup_; //!< The Pickupable the PickupIdentififer is for.
    7070            std::map<std::string, std::string> parameters_; //!< The parameters identifying the type of the pickup beyond the class.
    71            
     71
    7272    };
    73    
     73
    7474    /**
    7575    @brief
     
    8181            { return lhs->compare(rhs) < 0; }
    8282    };
    83    
     83
    8484}
    8585
  • code/branches/presentation3/src/orxonox/worldentities/Drone.h

    r7060 r7127  
    5353            virtual void tick(float dt); //!< Defines which actions the Drone has to take in each tick.
    5454
    55            
     55
    5656            virtual void moveFrontBack(const Vector2& value);
    5757            virtual void moveRightLeft(const Vector2& value);
     
    6161            virtual void rotatePitch(const Vector2& value);
    6262            virtual void rotateRoll(const Vector2& value);
    63            
     63
    6464            /**
    6565            @brief Moves the Drone in the Front/Back-direction by the specifed amount.
     
    8080            inline void moveUpDown(float value)
    8181            { this->moveUpDown(Vector2(value, 0)); }
    82            
     82
    8383            /**
    8484            @brief Rotates the Drone around the y-axis by the specifed amount.
     
    9999            inline void rotateRoll(float value)
    100100            { this->rotateRoll(Vector2(value, 0)); }
    101            
     101
    102102            /**
    103103            @brief Sets the primary thrust to the input amount.
     
    105105            */
    106106            inline void setPrimaryThrust( float thrust )
    107                 { this->primaryThrust_=thrust; }     
     107                { this->primaryThrust_=thrust; }
    108108            inline void setAuxilaryThrust( float thrust )
    109                 { this->auxilaryThrust_=thrust; }     
     109                { this->auxilaryThrust_=thrust; }
    110110            inline void setRotationThrust( float thrust )
    111                 { this->rotationThrust_=thrust; }     
     111                { this->rotationThrust_=thrust; }
    112112            inline void setMaxDistanceToOwner( float distance)
    113113                { this->maxDistanceToOwner_=distance; }
     
    117117                { this->maxShootingRange_=distance; }
    118118
    119            
     119
    120120            /**
    121121            @brief Gets the primary thrust to the input amount.
     
    134134            inline float getMaxShootingRange()
    135135                { return this->maxShootingRange_; }
    136            
     136
    137137        private:
    138138            DroneController *myController_; //!< The controller of the Drone.
    139            
     139
    140140            btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the Drone the next tick.
    141141            btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the Drone the next tick.
    142             float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward. 
     142            float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
    143143            float auxilaryThrust_; //!< The amount of auxilary thrust. Used for all other movements (except for rotations).
    144144            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.
  • code/branches/presentation3/src/orxonox/worldentities/WorldEntity.cc

    r6524 r7127  
    8181        this->node_->setPosition(Vector3::ZERO);
    8282        this->node_->setOrientation(Quaternion::IDENTITY);
    83        
     83
    8484        // Activity and visibility memory.
    8585        this->bActiveMem_ = true;
     
    205205        registerVariable(this->parentID_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));
    206206    }
    207    
     207
    208208    /**
    209209    @brief
     
    213213    {
    214214        SUPER(WorldEntity, changedActivity);
    215        
     215
    216216        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    217217        {
     
    227227        }
    228228    }
    229    
     229
    230230    /**
    231231    @brief
     
    235235    {
    236236        SUPER(WorldEntity, changedVisibility);
    237        
     237
    238238        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    239239        {
  • code/branches/presentation3/src/orxonox/worldentities/WorldEntity.h

    r6524 r7127  
    105105            static const Vector3 DOWN;
    106106            static const Vector3 UP;
    107            
     107
    108108            virtual void changedActivity(void);
    109109            virtual void changedVisibility(void);
     
    234234            std::set<WorldEntity*> children_;
    235235            bool bDeleteWithParent_;
    236            
     236
    237237            bool bActiveMem_;
    238238            bool bVisibleMem_;
Note: See TracChangeset for help on using the changeset viewer.