Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc @ 12307

Last change on this file since 12307 was 12307, checked in by ahuwyler, 5 years ago

A Stone is in the game/ Templates are ajusted

File size: 1.4 KB
Line 
1#include "OrxoBloxWall.h"
2#include "core/CoreIncludes.h"
3#include "core/XMLPort.h"
4
5#include "OrxoBlox.h"
6
7namespace orxonox
8{
9    RegisterClass(OrxoBloxWall);
10    /**
11    @brief
12        Constructor. Registers and initializes the object.
13    */
14    OrxoBloxWall::OrxoBloxWall(Context* context) : StaticEntity(context)
15    {
16        RegisterObject(OrxoBloxWall);
17
18        this->health_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;
19        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;
46    }
47}
Note: See TracBrowser for help on using the repository browser.