Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2016, 4:08:07 PM (8 years ago)
Author:
plehmann
Message:

scriptcontroller task system doesnt work. it seems like queue is the wrong data structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc

    r11172 r11178  
    4545
    4646#include "DebugTask.h"
     47#include "stringOutTask.h"
    4748#include "Task.h"
    4849#include "infos/PlayerInfo.h"
     
    7071
    7172        this->context_ = context;
    72 
    73         task_ = new DebugTask(context);
    74 
    75         //taskQueue_->push(new DebugTask);
    76 
    7773    }
    7874
     
    119115        if( !(this->entity_) ) return;
    120116
    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        }
    122135    }
    123136
     
    125138    void NewScriptController::createAndAddTask(Task newTask)
    126139    {
    127       taskQueue_->push(newTask);
     140      //taskQueue_->push(newTask);
    128141    }
    129142
    130143    void NewScriptController::debugOut(float startTime)
    131144    {
    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);
    135155    }
    136156
Note: See TracChangeset for help on using the changeset viewer.