- Timestamp:
- Apr 21, 2016, 4:02:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
r11167 r11172 44 44 #include "NewScriptController.h" 45 45 46 #include "DebugTask.h" 46 47 #include "Task.h" 47 48 #include "infos/PlayerInfo.h" 48 49 #include "core/CoreIncludes.h" 49 50 #include "worldentities/ControllableEntity.h" 50 #include "core/LuaState.h"51 51 #include "core/LuaState.h" 52 52 #include "util/Math.h" … … 69 69 this->scTime_ = 0.0f; 70 70 71 //taskList_->push(new DebugTask); 71 this->context_ = context; 72 73 task_ = new DebugTask(context); 74 75 //taskQueue_->push(new DebugTask); 72 76 73 77 } … … 111 115 SUPER(NewScriptController, tick, dt); 112 116 113 /* 117 114 118 // If this controller has no entity entry, do nothing 115 119 if( !(this->entity_) ) return; 116 120 117 // See if time has come for the next event to be run 118 if(this->taskList_->size() > 0 && this->taskList_->front().getStartTime() <= scTime_) 119 { // Execute the next event on the list 120 activeTasks_->push_back(taskList_->front()); 121 taskList_->pop(); 122 } 123 124 // Update the local timers in this object 125 scTime_ += dt; 126 127 // tick active tasks and delete completed tasks 128 for(std::vector<Task>::iterator it = activeTasks_->begin(); it != activeTasks_->end(); it++) 129 { 130 it->tick(dt); 131 if ( !(it->getIsRunning()) ) 132 { 133 activeTasks_->erase(it); 134 it--; 135 } 136 137 } 138 */ 121 taskQueue_->first()->tick(); 139 122 } 140 123 … … 142 125 void NewScriptController::createAndAddTask(Task newTask) 143 126 { 144 task List_->push(newTask);127 taskQueue_->push(newTask); 145 128 } 146 129 147 void NewScriptController::debugOut( )130 void NewScriptController::debugOut(float startTime) 148 131 { 149 orxout() << "NewScriptController: Taking control" << endl; 132 DebugTask* task = new DebugTask(context); 133 task->initialize(10000); 134 taskQueue_->push(task); 150 135 } 151 136 152 NewScriptController* NewScriptController::getNewScriptController() 137 NewScriptController* NewScriptController::getNewScriptController() 153 138 { 154 139 /* Output a message that confirms this function was called */
Note: See TracChangeset
for help on using the changeset viewer.