Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 18, 2019, 3:00:44 PM (5 years ago)
Author:
ahuwyler
Message:

A Stone is in the game/ Templates are ajusted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc

    r12278 r12307  
    1616        RegisterObject(OrxoBloxWall);
    1717
    18         this->health_ = 10;
     18        this->health_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;
    1919        this->delay_ = false;
     20        this->orxoblox_ = this->getOrxoBlox();
     21
     22
     23        OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
     24        if(this->orxoblox_ != nullptr)
     25            {
     26                stone->setGame(this->orxoblox_);
     27                if(this->orxoblox_->getCenterpoint() != nullptr)
     28                    stone->addTemplate(this->orxoblox_->getCenterpoint()->getStoneTemplate());
     29                else
     30                    orxout()<< "tetris_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl;
     31            }
     32            else
     33                orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl;
     34    }
     35
     36
     37    OrxoBlox* OrxoBloxWall::getOrxoBlox()
     38    {
     39        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(OrxoBlox)))
     40        {
     41            OrxoBlox* orxobloxGametype = orxonox_cast<OrxoBlox*>(this->getGametype());
     42            return orxobloxGametype;
     43        }
     44        else orxout()<<"There is no Gametype! ask Anna"<< endl;
     45        return nullptr;
    2046    }
    2147}
Note: See TracChangeset for help on using the changeset viewer.