Changeset 11178 for code/branches/plehmannFS16/src/orxonox
- Timestamp:
- Apr 28, 2016, 4:08:07 PM (9 years ago)
- Location:
- code/branches/plehmannFS16/src/orxonox/controllers
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt
r11172 r11178 5 5 ArtificialController.cc 6 6 AIController.cc 7 8 7 WaypointController.cc 9 8 WaypointPatrolController.cc … … 22 21 Task.cc 23 22 DebugTask.cc 23 stringOutTask.cc 24 24 ) -
code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc
r11172 r11178 46 46 void DebugTask::tick(float dt) 47 47 { 48 SUPER(DebugTask, tick, dt);49 48 orxout() << "*" << endl; 50 49 } -
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
r11172 r11178 45 45 46 46 #include "DebugTask.h" 47 #include "stringOutTask.h" 47 48 #include "Task.h" 48 49 #include "infos/PlayerInfo.h" … … 70 71 71 72 this->context_ = context; 72 73 task_ = new DebugTask(context);74 75 //taskQueue_->push(new DebugTask);76 77 73 } 78 74 … … 119 115 if( !(this->entity_) ) return; 120 116 121 taskQueue_->first()->tick(); 117 118 /* 119 if(taskQueue_.front()->getStartTime() <= scTime_) 120 { 121 activeTasks_.push_back(taskQueue_.front()); 122 taskQueue_.pop(); 123 } 124 125 for(Task* task : activeTasks_) 126 { 127 task->tick(dt); 128 }*/ 129 130 if(taskQueue_.front() != nullptr) 131 { 132 orxout() << taskQueue_.front() << endl; 133 //taskQueue_.front()->tick(dt); 134 } 122 135 } 123 136 … … 125 138 void NewScriptController::createAndAddTask(Task newTask) 126 139 { 127 taskQueue_->push(newTask);140 //taskQueue_->push(newTask); 128 141 } 129 142 130 143 void NewScriptController::debugOut(float startTime) 131 144 { 132 DebugTask* task = new DebugTask(context); 133 task->initialize(10000); 134 taskQueue_->push(task); 145 DebugTask* task = new DebugTask(context_); 146 task->initialize(startTime); 147 taskQueue_.push(task); 148 } 149 150 void NewScriptController::stringOut(float startTime, std::string output) 151 { 152 stringOutTask* task = new stringOutTask(context_); 153 task->initialize(startTime, output); 154 taskQueue_.push(task); 135 155 } 136 156 -
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h
r11172 r11178 31 31 32 32 #include "DebugTask.h" 33 #include "stringOutTask.h" 33 34 #include "Task.h" 34 35 #include "OrxonoxPrereqs.h" /* die ganzen tolua, kopiert aus Dock.h*/ … … 57 58 // LUA interface 58 59 59 void debugOut(float startTime);// tolua_export 60 void debugOut(float startTime);// tolua_export 61 62 void stringOut(float startTime, std::string output);// tolua_export 60 63 61 64 static NewScriptController* getNewScriptController();// tolua_export 62 65 63 66 int getID() { return ctrlid_; }// tolua_export 67 68 void printDebug() {orxout() << "fffff" << endl;} // tolua_export 64 69 65 70 … … 80 85 81 86 // List of events to walk through 82 std::queue<Task*> *taskQueue_;87 std::queue<Task*> taskQueue_; 83 88 84 89 85 90 //List of Tasks currently active 86 std::vector<Task*> *activeTasks_;91 std::vector<Task*> activeTasks_; 87 92 88 93 // Time since the creation of this ScriptController object 89 94 float scTime_; 90 95 91 DebugTask* task_;92 96 93 context* context_; 97 // context of the Controller to create the tasks 98 Context* context_; 94 99 95 100 -
code/branches/plehmannFS16/src/orxonox/controllers/Task.h
r11172 r11178 32 32 #include "infos/PlayerInfo.h" 33 33 #include "tools/interfaces/Tickable.h" 34 #include "core/class/OrxonoxClass.h" 34 35 35 36 namespace orxonox 36 37 { 37 class _OrxonoxExport Task : public Tickable38 {38 class _OrxonoxExport Task : public OrxonoxClass { 39 39 40 public: 40 41 Task(Context* context); … … 44 45 void initialize(float startTime); 45 46 46 virtual void tick(float dt) override;47 virtual void tick(float dt); 47 48 48 49 void setIsRunning(bool shouldBeRunning)
Note: See TracChangeset
for help on using the changeset viewer.