- Timestamp:
- May 2, 2019, 3:30:57 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
r12308 r12331 4 4 5 5 #include "OrxoBlox.h" 6 #include "OrxoBloxStones.h" 7 #include "OrxoBloxCenterpoint.h" 8 #include "util/Math.h" 6 9 7 10 namespace orxonox … … 16 19 RegisterObject(OrxoBloxWall); 17 20 18 this-> health_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;21 this->num_Stones_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7; 19 22 this->delay_ = false; 20 23 this->orxoblox_ = this->getOrxoBlox(); 24 this->createWall(); 25 } 21 26 22 27 23 OrxoBloxStones* stone = new OrxoBloxStones(this->getContext()); 24 if(this->orxoblox_ != nullptr) 28 void OrxoBloxWall::createWall(void){ 29 30 for (unsigned int i=0; i<this->num_Stones_;++i){ 31 OrxoBloxStones* stone = new OrxoBloxStones(this->getContext()); 32 33 34 this->TotalStones_.push_back(stone); 35 this->attach(stone); 36 37 stone->setPosition(0.0f, i, 0.0f); 38 39 40 41 if(this->orxoblox_ != nullptr) 25 42 { 26 43 stone->setGame(this->orxoblox_); … … 32 49 else 33 50 orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl; 51 52 } 53 54 55 56 // OrxoBloxStones* stone = new OrxoBloxStones(this->getContext()); 57 // if(this->orxoblox_ != nullptr) 58 // { 59 // stone->setGame(this->orxoblox_); 60 // if(this->orxoblox_->getCenterpoint() != nullptr) 61 // stone->addTemplate(this->orxoblox_->getCenterpoint()->getStoneTemplate()); 62 // else 63 // orxout()<< "orxoblox_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl; 64 // } 65 // else 66 // orxout()<< "orxoblox_ == nullptr in TetrisBrick.cc"<< endl; 34 67 } 35 68 69 OrxoBloxStones* OrxoBloxWall::getStone(unsigned int i) 70 { 71 if(i < this->TotalStones_.size()) 72 return this->TotalStones_[i]; 73 else return nullptr; 74 } 36 75 37 76 OrxoBlox* OrxoBloxWall::getOrxoBlox()
Note: See TracChangeset
for help on using the changeset viewer.