void ObstacleFactory::update( float time ) { Obstacle* b; std::string name; for (ObstacleIterator ei = ObstacleList.begin(); ei != ObstacleList.end(); ){ b = *ei; b->update(time); ei++; if(b->die) { delete b; b = 0; } name = b->getName(); sillyRotation(time, b->getSceneNode()); if(hit) sillyHitCamera(time, b->getSceneNode()); } if(!hit) debug->setText("false"); //resetPath(); //ObstacleList.clear(); }
Obstacle* ObstacleFactory::generate() { Obstacle *base = new Obstacle(IDCounter); base->setUp(); //debug->setText("entity: " + entity->getName() + ", Node: " + sceneNode->getName() ); //ObstacleList.push_back(base); ObstacleIterator itr = ObstacleList.insert(ObstacleList.end(), base); ObstacleIndex.insert(std::make_pair(base->getName(), itr)); base->getSceneNode()->scale(3,3,3); //debug->setText("size is " + convertInt(ObstacleList.size())); //debug->setText(get(appropriateName(ENTITY).substr(8))->getName()); IDCounter++; return base; }