Changeset 11187
- Timestamp:
- May 12, 2016, 4:08:32 PM (9 years ago)
- Location:
- code/branches/plehmannFS16/src/orxonox/controllers
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
r11183 r11187 135 135 orxout() << this->scTime_ << endl; 136 136 137 if(this->taskList_.front() ->getStartTime() < this->scTime_)137 if(this->taskList_.front().getStartTime() < this->scTime_) 138 138 { 139 139 activeTasks_.push_back(this->taskList_.front()); … … 146 146 } 147 147 148 for (std::vector<Task*>::iterator it = activeTasks_.begin(); it != activeTasks_.end(); it++) 149 { 150 if( !((*it)->update(dt)) ) 151 { 152 delete (*it); // delete the task that was created with new 148 for (std::vector<Task>::iterator it = activeTasks_.begin(); it != activeTasks_.end(); it++) 149 { 150 if( !(it->update(dt)) ) 151 { 153 152 activeTasks_.erase(it); 154 153 it--; // set back the iterator so we continue with the next element and not with the one after that … … 168 167 void NewScriptController::debugOut(float startTime) 169 168 { 170 DebugTask * task = newDebugTask(context_);171 task ->initialize(startTime);169 DebugTask task = DebugTask(context_); 170 task.initialize(startTime); 172 171 173 172 if(taskList_.empty()) … … 178 177 else 179 178 { 180 for (std::list<Task *>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime179 for (std::list<Task>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime 181 180 { 182 181 orxout() << taskList_.empty() << endl; 183 182 184 if(task ->getStartTime() < (*it)->getStartTime() )183 if(task.getStartTime() < it->getStartTime() ) 185 184 { 186 185 taskList_.insert(it, task); … … 192 191 void NewScriptController::stringOut(float startTime, std::string output) 193 192 { 194 stringOutTask * task = newstringOutTask(context_);195 task ->initialize(startTime, output);193 stringOutTask task = stringOutTask(context_); 194 task.initialize(startTime, output); 196 195 197 196 if(taskList_.empty()) … … 202 201 else 203 202 { 204 for (std::list<Task *>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime203 for (std::list<Task>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime 205 204 { 206 205 orxout() << taskList_.empty() << endl; 207 206 208 if(task ->getStartTime() < (*it)->getStartTime() )207 if(task.getStartTime() < it->getStartTime() ) 209 208 { 210 209 taskList_.insert(it, task); -
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h
r11183 r11187 85 85 86 86 // List of events to walk through sorted by starting times 87 std::list<Task *> taskList_;87 std::list<Task> taskList_; 88 88 89 89 90 90 //List of Tasks currently active 91 std::vector<Task *> activeTasks_;91 std::vector<Task> activeTasks_; 92 92 93 93 // Time since the creation of this ScriptController object
Note: See TracChangeset
for help on using the changeset viewer.