Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/tetris/CMakeLists.txt

    r9348 r10624  
    88
    99ORXONOX_ADD_LIBRARY(tetris
    10   MODULE
     10  PLUGIN
    1111  FIND_HEADER_FILES
    1212  LINK_LIBRARIES
  • code/trunk/src/modules/tetris/Tetris.cc

    r9834 r10624  
    104104        }
    105105
    106         for (std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     106        for (std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    107107            (*it)->destroy();
    108108        this->stones_.clear();
     
    136136            return false;
    137137
    138         for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     138        for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    139139        {
    140140            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     
    192192
    193193        // check for collisions with all stones
    194         for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     194        for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    195195        {
    196196            //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
     
    469469        {
    470470            stonesPerRow = 0;
    471             for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
    472             {
    473                 std::list<SmartPtr<TetrisStone> >::iterator it_temp = it++;
     471            for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
     472            {
     473                std::list<StrongPtr<TetrisStone> >::iterator it_temp = it++;
    474474                correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize());
    475475                if(correctPosition == row)
     
    491491    void Tetris::clearRow(unsigned int row)
    492492    {// clear the full row
    493         for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
     493        for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
    494494        {
    495495            if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row)
     
    502502        }
    503503      // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug.
    504         for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     504        for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    505505        {
    506506            if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
  • code/trunk/src/modules/tetris/Tetris.h

    r10622 r10624  
    6969
    7070            PlayerInfo* getPlayer(void) const; //!< Get the player.
    71             WeakPtr<TetrisCenterpoint> getCenterpoint(void)
     71            TetrisCenterpoint* getCenterpoint(void)
    7272                { return this->center_; }
    7373
     
    9393
    9494            WeakPtr<TetrisCenterpoint> center_; //!< The playing field.
    95             std::list<SmartPtr<TetrisStone> > stones_; //!< A list of all stones in play.
     95            std::list<StrongPtr<TetrisStone> > stones_; //!< A list of all stones in play.
    9696            WeakPtr<TetrisBrick> activeBrick_;
    9797            WeakPtr<TetrisBrick> futureBrick_;
  • code/trunk/src/modules/tetris/TetrisBrick.cc

    r10262 r10624  
    169169        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
    170170        {
    171             Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
     171            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
    172172            return tetrisGametype;
    173173        }
  • code/trunk/src/modules/tetris/TetrisCenterpoint.cc

    r9667 r10624  
    8080    /**
    8181    @brief
    82         Is called when the gametype has changed.
    83     */
    84     void TetrisCenterpoint::changedGametype()
    85     {
    86         SUPER(TetrisCenterpoint, changedGametype);
    87 
    88         // Check, whether it's still Tetris.
    89         this->checkGametype();
    90     }
    91 
    92     /**
    93     @brief
    9482        Checks whether the gametype is Tetris and if it is, sets its centerpoint.
    9583    */
     
    9886        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
    9987        {
    100             Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
     88            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
    10189            tetrisGametype->setCenterpoint(this);
    10290        }
  • code/trunk/src/modules/tetris/TetrisCenterpoint.h

    r9667 r10624  
    6464            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a TetrisCenterpoint through XML.
    6565
    66             virtual void changedGametype(); //!< Is called when the gametype has changed.
    67            
    6866            /**
    6967            @brief Set the width of the playing field.
  • code/trunk/src/modules/tetris/TetrisScore.cc

    r10262 r10624  
    118118
    119119        if (this->getOwner() != NULL && this->getOwner()->getGametype())
    120             this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype().get());
     120            this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype());
    121121        else
    122122            this->owner_ = 0;
Note: See TracChangeset for help on using the changeset viewer.