Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2016, 4:02:06 PM (8 years ago)
Author:
plehmann
Message:

updated some files so NewScriptController lua binds are created. added DebugTask to cmake.

File:
1 edited

Legend:

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

    r11167 r11172  
    4444#include "NewScriptController.h"
    4545
     46#include "DebugTask.h"
    4647#include "Task.h"
    4748#include "infos/PlayerInfo.h"
    4849#include "core/CoreIncludes.h"
    4950#include "worldentities/ControllableEntity.h"
    50 #include "core/LuaState.h"
    5151#include "core/LuaState.h"
    5252#include "util/Math.h"
     
    6969        this->scTime_ = 0.0f;
    7070
    71         //taskList_->push(new DebugTask);
     71        this->context_ = context;
     72
     73        task_ = new DebugTask(context);
     74
     75        //taskQueue_->push(new DebugTask);
    7276
    7377    }
     
    111115        SUPER(NewScriptController, tick, dt);
    112116
    113 /*
     117
    114118        // If this controller has no entity entry, do nothing
    115119        if( !(this->entity_) ) return;
    116120
    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();
    139122    }
    140123
     
    142125    void NewScriptController::createAndAddTask(Task newTask)
    143126    {
    144       taskList_->push(newTask);
     127      taskQueue_->push(newTask);
    145128    }
    146129
    147     void NewScriptController::debugOut()
     130    void NewScriptController::debugOut(float startTime)
    148131    {
    149       orxout() << "NewScriptController: Taking control" << endl;
     132      DebugTask* task = new DebugTask(context);
     133      task->initialize(10000);
     134      taskQueue_->push(task);
    150135    }
    151136
    152     NewScriptController* NewScriptController::getNewScriptController()
     137    NewScriptController* NewScriptController::getNewScriptController() 
    153138    {
    154139      /* Output a message that confirms this function was called */
Note: See TracChangeset for help on using the changeset viewer.