[Orxonox-commit 6542] r11183 - in code/branches/plehmannFS16: data/gui/scripts src/orxonox/controllers src/orxonox/controllers/scriptTasks
plehmann at orxonox.net
plehmann at orxonox.net
Thu May 12 15:28:31 CEST 2016
Author: plehmann
Date: 2016-05-12 15:28:30 +0200 (Thu, 12 May 2016)
New Revision: 11183
Added:
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.cc
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.h
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.cc
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.h
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.cc
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.h
Removed:
code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc
code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h
code/branches/plehmannFS16/src/orxonox/controllers/Task.cc
code/branches/plehmannFS16/src/orxonox/controllers/Task.h
code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.cc
code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.h
Modified:
code/branches/plehmannFS16/data/gui/scripts/testscript.lua
code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h
Log:
moved the task classes to the scriptTasks folder. modified the NewScriptController to execute tasks when their time has come modified the tasks so that they tell the controller when they are done
Modified: code/branches/plehmannFS16/data/gui/scripts/testscript.lua
===================================================================
--- code/branches/plehmannFS16/data/gui/scripts/testscript.lua 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/data/gui/scripts/testscript.lua 2016-05-12 13:28:30 UTC (rev 11183)
@@ -22,9 +22,9 @@
-- If it worked, call its "movetoposition" function
if ctrl ~= nil then
- --ctrl:printDebug()
- --ctrl:debugOut(1000)
- --ctrl:stringOut(10000, "hello")
+ ctrl:printDebug()
+ ctrl:debugOut(5)
+ ctrl:stringOut(3, "hello")
--ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 10)
-- ctrl:eventScheduler("ral", xl, yl, zl, 3, 3000, 0, math.pi)
-- ctrl:eventScheduler("idle", 1)
Modified: code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt 2016-05-12 13:28:30 UTC (rev 11183)
@@ -18,7 +18,5 @@
FightingController.cc
MasterController.cc
NewScriptController.cc
- Task.cc
- DebugTask.cc
- stringOutTask.cc
)
+ADD_SUBDIRECTORY(scriptTasks)
\ No newline at end of file
Deleted: code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc 2016-05-12 13:28:30 UTC (rev 11183)
@@ -1,51 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Paul Lehmann
- * Co-authors:
- * ...
- *
- */
-
-
-#include "DebugTask.h"
-
-#include "infos/PlayerInfo.h"
-#include "controllers/ArtificialController.h"
-#include "tools/interfaces/Tickable.h"
-
-namespace orxonox
-{
-
- RegisterClass(DebugTask);
-
- DebugTask::DebugTask(Context* context): Task(context)
- {
- RegisterObject(DebugTask);
- }
-
- void DebugTask::tick(float dt)
- {
- orxout() << "*" << endl;
- }
-
-}
\ No newline at end of file
Deleted: code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h 2016-05-12 13:28:30 UTC (rev 11183)
@@ -1,55 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Paul Lehmann
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _DebugTask_H__
-#define _DebugTask_H__
-
-#include "infos/PlayerInfo.h"
-#include "controllers/ArtificialController.h"
-#include "tools/interfaces/Tickable.h"
-#include "Task.h"
-
-namespace orxonox
-{
- class _OrxonoxExport DebugTask : public Task
- {
- public:
- DebugTask(Context* context);
- virtual ~DebugTask(){}
-
- void initialize(float startTime)
- {this->startTime_ = startTime;}
-
- virtual void tick(float dt) override;
-
- private:
-
- };
-}
-
-#endif /* _DebugTask_H__ */
Modified: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc 2016-05-12 13:28:30 UTC (rev 11183)
@@ -43,9 +43,9 @@
#include "NewScriptController.h"
-#include "DebugTask.h"
-#include "stringOutTask.h"
-#include "Task.h"
+#include "scriptTasks/DebugTask.h"
+#include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/Task.h"
#include "infos/PlayerInfo.h"
#include "core/CoreIncludes.h"
#include "worldentities/ControllableEntity.h"
@@ -70,6 +70,8 @@
this->scTime_ = 0.0f;
this->context_ = context;
+
+
}
@@ -86,9 +88,9 @@
assert(this->entity_);
this->ctrlid_ = ctrlid;
- if (ctrlid_ == 0)
+ if (this->ctrlid_ == 0)
{
- ctrlid_ = 1;
+ this->ctrlid_ = 1;
}
// Add the controller here to this entity. Apparently this still leaves
@@ -127,11 +129,34 @@
task->tick(dt);
}*/
- if(taskQueue_.front() != nullptr)
+ if(this->taskList_.size() != 0)
{
- orxout() << taskQueue_.front() << endl;
- //taskQueue_.front()->tick(dt);
+
+ orxout() << this->scTime_ << endl;
+
+ if(this->taskList_.front()->getStartTime() < this->scTime_)
+ {
+ activeTasks_.push_back(this->taskList_.front());
+ this->taskList_.pop_front();
+ }
}
+ else
+ {
+ //orxout() << "no tasks in taskList_" << endl;
+ }
+
+ for (std::vector<Task*>::iterator it = activeTasks_.begin(); it != activeTasks_.end(); it++)
+ {
+ if( !((*it)->update(dt)) )
+ {
+ delete (*it); // delete the task that was created with new
+ activeTasks_.erase(it);
+ it--; // set back the iterator so we continue with the next element and not with the one after that
+ }
+ }
+
+
+ scTime_ += dt;
}
@@ -144,14 +169,48 @@
{
DebugTask* task = new DebugTask(context_);
task->initialize(startTime);
- taskQueue_.push(task);
+
+ if(taskList_.empty())
+ {
+ taskList_.push_front(task);
+ }
+
+ else
+ {
+ for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+ {
+ orxout() << taskList_.empty() << endl;
+
+ if(task->getStartTime() < (*it)->getStartTime() )
+ {
+ taskList_.insert(it, task);
+ }
+ }
+ }
}
void NewScriptController::stringOut(float startTime, std::string output)
{
stringOutTask* task = new stringOutTask(context_);
task->initialize(startTime, output);
- taskQueue_.push(task);
+
+ if(taskList_.empty())
+ {
+ taskList_.push_front(task);
+ }
+
+ else
+ {
+ for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+ {
+ orxout() << taskList_.empty() << endl;
+
+ if(task->getStartTime() < (*it)->getStartTime() )
+ {
+ taskList_.insert(it, task);
+ }
+ }
+ }
}
NewScriptController* NewScriptController::getNewScriptController()
Modified: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h 2016-05-12 13:28:30 UTC (rev 11183)
@@ -29,9 +29,9 @@
#ifndef _NewScriptController_H__
#define _NewScriptController_H__
-#include "DebugTask.h"
-#include "stringOutTask.h"
-#include "Task.h"
+#include "scriptTasks/DebugTask.h"
+#include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/Task.h"
#include "OrxonoxPrereqs.h" /* die ganzen tolua, kopiert aus Dock.h*/
#include "ArtificialController.h"
#include "core/EventIncludes.h"
@@ -83,8 +83,8 @@
// Controller ID, defaults to 0 and is set using takeControl()
int ctrlid_;
- // List of events to walk through
- std::queue<Task*> taskQueue_;
+ // List of events to walk through sorted by starting times
+ std::list<Task*> taskList_;
//List of Tasks currently active
Deleted: code/branches/plehmannFS16/src/orxonox/controllers/Task.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/Task.cc 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/Task.cc 2016-05-12 13:28:30 UTC (rev 11183)
@@ -1,56 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Paul Lehmann
- * Co-authors:
- * ...
- *
- */
-
-
-#include "Task.h"
-
-#include "infos/PlayerInfo.h"
-#include "tools/interfaces/Tickable.h"
-
-namespace orxonox
-{
-
- RegisterClass(Task);
-
- Task::Task(Context* context) : isRunning_(false)
- {
- RegisterObject(Task);
- startTime_ = -1;
- }
-
- void Task::initialize(float startTime)
- {
- startTime_ = startTime;
- }
-
- void Task::tick(float dt)
- {
- SUPER(Task, tick, dt);
- }
-
-}
\ No newline at end of file
Deleted: code/branches/plehmannFS16/src/orxonox/controllers/Task.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/Task.h 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/Task.h 2016-05-12 13:28:30 UTC (rev 11183)
@@ -1,67 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Paul Lehmann
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _Task_H__
-#define _Task_H__
-
-#include "infos/PlayerInfo.h"
-#include "tools/interfaces/Tickable.h"
-#include "core/class/OrxonoxClass.h"
-
-namespace orxonox
-{
- class _OrxonoxExport Task : public OrxonoxClass {
-
- public:
- Task(Context* context);
- virtual ~Task(){}
-
- //this function needs to be called otherwise the task is never carriedout
- void initialize(float startTime);
-
- virtual void tick(float dt);
-
- void setIsRunning(bool shouldBeRunning)
- {isRunning_ = shouldBeRunning;}
-
- bool getIsRunning()
- {return isRunning_;}
-
- float getStartTime()
- {return startTime_;}
-
- //private:
-
- bool isRunning_;
-
- float startTime_;
-
- };
-}
-
-#endif /* _Task_H__ */
Added: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt (rev 0)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt 2016-05-12 13:28:30 UTC (rev 11183)
@@ -0,0 +1,5 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ Task.cc
+ DebugTask.cc
+ stringOutTask.cc
+)
\ No newline at end of file
Added: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.cc (rev 0)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.cc 2016-05-12 13:28:30 UTC (rev 11183)
@@ -0,0 +1,62 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ */
+
+
+#include "DebugTask.h"
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+
+ RegisterClass(DebugTask);
+
+ DebugTask::DebugTask(Context* context): Task(context)
+ {
+ RegisterObject(DebugTask);
+ counter = 0;
+ }
+
+ bool DebugTask::update(float dt)
+ {
+ orxout() << "*" << endl;
+
+ if (counter == 10)
+ {
+ return false;
+ }
+ else
+ {
+ counter++;
+ return true;
+ }
+ }
+
+}
\ No newline at end of file
Added: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.h (rev 0)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/DebugTask.h 2016-05-12 13:28:30 UTC (rev 11183)
@@ -0,0 +1,57 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _DebugTask_H__
+#define _DebugTask_H__
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+#include "Task.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport DebugTask : public Task
+ {
+ public:
+ DebugTask(Context* context);
+ virtual ~DebugTask(){}
+
+ void initialize(float startTime)
+ {this->startTime_ = startTime;}
+
+ virtual bool update(float dt) override;
+
+ private:
+
+ int counter;
+
+ };
+}
+
+#endif /* _DebugTask_H__ */
Added: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.cc (rev 0)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.cc 2016-05-12 13:28:30 UTC (rev 11183)
@@ -0,0 +1,56 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ */
+
+
+#include "Task.h"
+
+#include "infos/PlayerInfo.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+
+ RegisterClass(Task);
+
+ Task::Task(Context* context)
+ {
+ RegisterObject(Task);
+ startTime_ = -1;
+ }
+
+ void Task::initialize(float startTime)
+ {
+ startTime_ = startTime;
+ }
+
+ bool Task::update(float dt)
+ {
+ SUPER(Task, tick, dt);
+ }
+
+}
\ No newline at end of file
Added: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.h (rev 0)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.h 2016-05-12 13:28:30 UTC (rev 11183)
@@ -0,0 +1,60 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _Task_H__
+#define _Task_H__
+
+#include "infos/PlayerInfo.h"
+#include "tools/interfaces/Tickable.h"
+#include "core/class/OrxonoxClass.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport Task : public OrxonoxClass {
+
+ public:
+ Task(Context* context);
+ virtual ~Task(){}
+
+ //this function needs to be called otherwise the task is never carried out
+ void initialize(float startTime);
+
+ //important return true while the task is running and false to stop it!!!
+ virtual bool update(float dt);
+
+ float getStartTime()
+ {return startTime_;}
+
+ //private:
+
+ float startTime_;
+
+ };
+}
+
+#endif /* _Task_H__ */
Added: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.cc (rev 0)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.cc 2016-05-12 13:28:30 UTC (rev 11183)
@@ -0,0 +1,51 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ */
+
+
+#include "stringOutTask.h"
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+
+namespace orxonox
+{
+
+ RegisterClass(stringOutTask);
+
+ stringOutTask::stringOutTask(Context* context): Task(context)
+ {
+ RegisterObject(stringOutTask);
+ }
+
+ bool stringOutTask::update(float dt)
+ {
+ orxout() << output_ << endl;
+ return false;
+ }
+
+}
\ No newline at end of file
Added: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.h (rev 0)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/stringOutTask.h 2016-05-12 13:28:30 UTC (rev 11183)
@@ -0,0 +1,57 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _stringOutTask_H__
+#define _stringOutTask_H__
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+#include "Task.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport stringOutTask : public Task
+ {
+ public:
+ stringOutTask(Context* context);
+ virtual ~stringOutTask(){}
+
+ void initialize(float startTime, std::string output)
+ {this->startTime_ = startTime; this->output_ = output;}
+
+ virtual bool update(float dt) override;
+
+ private:
+
+ std::string output_;
+
+ };
+}
+
+#endif /* _stringOutTask_H__ */
\ No newline at end of file
Deleted: code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.cc 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.cc 2016-05-12 13:28:30 UTC (rev 11183)
@@ -1,50 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Paul Lehmann
- * Co-authors:
- * ...
- *
- */
-
-
-#include "stringOutTask.h"
-
-#include "infos/PlayerInfo.h"
-#include "controllers/ArtificialController.h"
-
-namespace orxonox
-{
-
- RegisterClass(stringOutTask);
-
- stringOutTask::stringOutTask(Context* context): Task(context)
- {
- RegisterObject(stringOutTask);
- }
-
- void stringOutTask::tick(float dt)
- {
- orxout() << output_ << endl;
- }
-
-}
\ No newline at end of file
Deleted: code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.h 2016-05-12 11:45:44 UTC (rev 11182)
+++ code/branches/plehmannFS16/src/orxonox/controllers/stringOutTask.h 2016-05-12 13:28:30 UTC (rev 11183)
@@ -1,57 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Paul Lehmann
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _stringOutTask_H__
-#define _stringOutTask_H__
-
-#include "infos/PlayerInfo.h"
-#include "controllers/ArtificialController.h"
-#include "tools/interfaces/Tickable.h"
-#include "Task.h"
-
-namespace orxonox
-{
- class _OrxonoxExport stringOutTask : public Task
- {
- public:
- stringOutTask(Context* context);
- virtual ~stringOutTask(){}
-
- void initialize(float startTime, std::string output)
- {this->startTime_ = startTime; this->output_ = output;}
-
- virtual void tick(float dt) override;
-
- private:
-
- std::string output_;
-
- };
-}
-
-#endif /* _stringOutTask_H__ */
\ No newline at end of file
More information about the Orxonox-commit
mailing list