#include <taskmanager.h>
Inherits Task.
Inheritance diagram for TaskManager:


Public Member Functions | |
| TaskManager () | |
| ~TaskManager () | |
| void | add (Task &task) |
| Add task to list of tasks - as last. | |
| void | remove (Task &task) |
| Remove task from task list. | |
| void | initTasks () |
| Inicialize all tasks. | |
| void | cleanTasks () |
| Clean all tasks. | |
| void | update (bool savecpu=true) |
| Update all tasks. | |
| virtual void | update (int atime) |
| Upate callback it taskmanager is part of other task manager. | |
| virtual void | addedWorldObject (WorldEntity *we) |
| Notify all tasks, that entity was added. | |
| virtual void | deletedWorldObject (WorldEntity *we) |
| Notify all tastks, that entity will be deleted. | |
Private Attributes | |
| int | mLastUpdate |
| std::list< Task * > | mTaskList |
| List to hold all tasks. | |
Every runing task should be added to this task manager. The task manager call update to tasks and notify them about new/deleted objects in game.
The task manager is also Task so you may include more manager into one tree. (don't do cycles :-)
Definition at line 20 of file taskmanager.h.
|
|
Definition at line 17 of file taskmanager.cpp. |
|
|
Definition at line 21 of file taskmanager.cpp. |
|
|
Add task to list of tasks - as last. You should add all tasks before using anything ither from TaskManager. Multiple calls with will add task mutiple times!
Definition at line 26 of file taskmanager.cpp. References mTaskList. Referenced by ApplicationServer::init(), ApplicationClient::init(), GameServer::run(), and GameClient::run(). |
|
|
Notify all tasks, that entity was added.
Reimplemented from Task. Definition at line 119 of file taskmanager.cpp. |
|
|
Clean all tasks. Die if any failure. Maybe we could be a less strict in final version and accept errors in cleaning :-) Definition at line 105 of file taskmanager.cpp. References assertL, mTaskList, and TIN. Referenced by GameClient::run(). |
|
|
Notify all tastks, that entity will be deleted.
Reimplemented from Task. Definition at line 132 of file taskmanager.cpp. |
|
|
Inicialize all tasks. Die if any failure. Must be called before any calls to update. Definition at line 46 of file taskmanager.cpp. References assertL, mTaskList, and TIN. Referenced by GameServer::run(), and GameClient::run(). |
|
|
Remove task from task list. If the task was added mutiple times only one is removed.
Definition at line 31 of file taskmanager.cpp. References assertL, and mTaskList. Referenced by GameClient::run(). |
|
|
Upate callback it taskmanager is part of other task manager. Equal to update(fale)
Reimplemented from Task. Definition at line 100 of file taskmanager.cpp. References update(). Here is the call graph for this function: ![]() |
|
|
Update all tasks. This shoul be often called from Engine. Since most of all game is done here.
Definition at line 69 of file taskmanager.cpp. References assertL, TimeManager::getTicks(), mTaskList, and TIN. Referenced by GameServer::run(), GameClient::run(), and update(). Here is the call graph for this function: ![]() |
|
|
Definition at line 95 of file taskmanager.h. |
|
|
List to hold all tasks.
Definition at line 97 of file taskmanager.h. Referenced by add(), addedWorldObject(), cleanTasks(), deletedWorldObject(), initTasks(), remove(), and update(). |
1.4.5