#include <dustytask.h>
Inheritance diagram for DustyEngine::Task:

Public Member Functions | |
| Task () | |
| The constructor sets the default values for all task variables. | |
| virtual | ~Task () |
| virtual void | OnCreation ()=0 |
| OnCreation() is called by the TaskTree when the task is added to the tree using the AddTask() function of the tree. | |
| virtual void | OnDestruction ()=0 |
| OnDestruction() is called by the TaskTree when the task is removed from the tree. | |
| virtual void | OnPause ()=0 |
| OnPause() is called when the task has been paused by the TaskTree. | |
| virtual void | OnUnpause ()=0 |
| OnUnpause() is called when the task has been unpaused by the TaskTree. | |
| virtual void | OnUpdate ()=0 |
| OnUpdate() is called by the TaskTree when the time has come to execute the task's code. | |
| virtual void | OnAddChild (Task *child)=0 |
| virtual void | OnRemoveChild (Task *child)=0 |
| virtual void | OnLifetimeExpired ()=0 |
| OnLifetimeExpired() is called by the TaskTree when the task's lifetime on the tree has expired, either number of executions or amount of time. | |
| virtual void | OnChildrenPaused ()=0 |
| OnChildrenPaused() is called by the TaskTree when PauseChildren has been called on this task, pausing all the task's children. | |
| virtual void | OnChildrenUnpaused ()=0 |
| OnChildrenUnpaused() is called by the TaskTree when UnpauseChildren has been called on this task, unpausing all the task's children. | |
| void | SetDustyDriver (DustyDriver *dd) |
| DustyDriver * | GetDustyDriver () |
| void | SetIrrlichtDevice (irr::IrrlichtDevice *device) |
| irr::IrrlichtDevice * | GetIrrlichtDevice () |
| void | SetPriority (irr::u32 p) |
| irr::u32 | GetPriority () |
| void | SetPaused (bool p) |
| bool | IsPaused () |
| void | SetParent (Task *p) |
| Task * | GetParent () |
| void | SetExecuteMultiple (bool execute) |
| bool | GetExecuteMultiple () |
| void | SetNumExecutions (irr::u32 n) |
| irr::u32 | GetNumExecutions () |
| void | SetDeltaTimer (DeltaTimer *entry) |
| DeltaTimer * | GetDeltaTimer () |
| void | SetPauseDelta (irr::u32 pd) |
| irr::u32 | GetPauseDelta () |
| void | SetLifetimeExecutions (irr::u32 lt) |
| irr::u32 | GetLifetimeExecutions () |
| void | SetLifetimeMS (irr::u32 lt) |
| irr::u32 | GetLifetimeMS () |
| void | SetCreationTime (irr::u32 ct) |
| irr::u32 | GetCreationTime () |
| void | SetTotalTimeDelta (irr::u32 ttd) |
| irr::u32 | GetTotalTimeDelta () |
| void | SetPauseUnpauseTime (irr::u32 t) |
| irr::u32 | GetPauseUnpauseTime () |
| void | SetTimeToStayPaused (irr::u32 t) |
| Sets the amount of time that this task should stay paused when it is paused by the task tree. If this value is not 0, then it represents the number of milliseconds the task will stay paused. After that time has passed, the task tree will automatically unpause it. If the value is 0, the task stays paused until manually unpaused. | |
| irr::u32 | GetTimeToStayPaused () |
| Returns the amount of time this task will stay paused when it is paused by the task tree. | |
| void | SetTimeToStayUnpaused (irr::u32 t) |
| Sets the amount of time this task should be allowed to run when it has been unpaused by the task tree. If this value is not 0, then the task tree will automatically pause the task after this time in milliseconds has passed. If the value is 0, then the task will stay paused until manually unpaused. | |
| irr::u32 | GetTimeToStayUnpaused () |
| Returns the amount of time this task will stay unpaused when it is unpaused by the task tree. | |
| void | AddChild (Task *child) |
| void | ClearChildren () |
| ClearChildren() will remove all the children from this task. | |
| void | RemoveChild (Task *child) |
| irr::core::list< Task * > * | GetChildren () |
| irr::u32 | NumChildren () |
| void | SetTag (irr::core::stringc t) |
| Sets the string tag associated with this task. The tag is for external use only, it is not used by Dusty Engine. | |
| irr::core::stringc | GetTag () |
| Gets the string tag associated with this task. | |
Protected Attributes | |
| irr::IrrlichtDevice * | irrlichtDevice |
| DustyDriver * | dustyDriver |
| irr::core::stringc | tag |
| irr::u32 | priority |
| irr::u32 | numExecutions |
| irr::u32 | pauseDelta |
| irr::u32 | lifetimeExecutions |
| irr::u32 | lifetimeMS |
| irr::u32 | creationTime |
| irr::u32 | totalTimeDelta |
| irr::u32 | pauseUnpauseTime |
| irr::u32 | timeToStayPaused |
| irr::u32 | timeToStayUnpaused |
| bool | paused |
| bool | executeMultiple |
| Task * | parent |
| DeltaTimer * | deltaTimer |
| irr::core::list< Task * > | children |
The Task class is the backbone of Dusty Engine. A task is a logical collection of code which accomplishes a certain task. This task may be as simple as moving an object on screen or as complex as updating the entire game logic. A task is executed by the TaskTree either every time TaskTree's DoUpdates() function is called or after a certain amount of time has passed. When a task is paused, it is seamless; unpausing it causes the task to pick right up exactly where it left off as though no time had passed at all.
ALL Update/Pause/Unpause/Destroy operations on tasks should be performed by the TaskTree to maintain consistency!
Definition at line 51 of file dustytask.h.
|
|
The constructor sets the default values for all task variables.
|
|
|
|
|
|
AddChild() adds a child to the task. This is called automatically by TaskTree's AddTask() function.
|
|
|
ClearChildren() will remove all the children from this task.
|
|
|
GetChildren() returns a pointer to the list of children this task has.
|
|
|
GetCreationTime() returns the time this task was created.
|
|
|
GetTimeServerEntry() returns the time server entry used by this task.
|
|
|
GetDustyDriver() returns a pointer to the DustyDriver used by this task.
|
|
|
GetExecuteMultiple() returns whether this task will update more than once if enough time has passed.
|
|
|
GetIrrlichtDevice() returns the IrrlichtDevice this task uses.
|
|
|
GetLifetimeExecutions() returns the amount of times the task will execute before being destroyed.
|
|
|
GetLifetimeMS() returns the number of milliseconds this task should exist on the task tree.
|
|
|
GetNumExecutions() returns the number of times the task has been updated.
|
|
|
GetParent() returns the parent of this task.
|
|
|
GetPauseDelta() returns the time-delta of the task at the moment it was paused by TaskTree.
|
|
|
|
|
|
GetPriority() returns the amount of time (in milliseconds) between executions of the task. This is called automatically by TaskTree's AddTask() function.
|
|
|
Gets the string tag associated with this task.
|
|
|
Returns the amount of time this task will stay paused when it is paused by the task tree.
|
|
|
Returns the amount of time this task will stay unpaused when it is unpaused by the task tree.
|
|
|
GetTotalTimeDelta() returns the total amount of time-delta time this task has had.
|
|
|
IsPaused() returns whether or not this task has been flagged as paused.
|
|
|
NumChildren() returns the number of children of this task.
|
|
|
OnAddChild() is called by the TaskTree when a child task has been added to this task.
Implemented in DustyEngine::DummyTask. |
|
|
OnChildrenPaused() is called by the TaskTree when PauseChildren has been called on this task, pausing all the task's children.
Implemented in DustyEngine::DummyTask. |
|
|
OnChildrenUnpaused() is called by the TaskTree when UnpauseChildren has been called on this task, unpausing all the task's children.
Implemented in DustyEngine::DummyTask, and DustyEngine::EntityParentTask. |
|
|
OnCreation() is called by the TaskTree when the task is added to the tree using the AddTask() function of the tree.
Implemented in DustyEngine::DummyTask. |
|
|
OnDestruction() is called by the TaskTree when the task is removed from the tree.
Implemented in DustyEngine::DummyTask. |
|
|
OnLifetimeExpired() is called by the TaskTree when the task's lifetime on the tree has expired, either number of executions or amount of time.
Implemented in DustyEngine::DummyTask. |
|
|
OnPause() is called when the task has been paused by the TaskTree.
Implemented in DustyEngine::DummyTask, and DustyEngine::EntityParentTask. |
|
|
OnRemoveChild() is called by the TaskTree when a child has been removed from this task.
Implemented in DustyEngine::DummyTask. |
|
|
OnUnpause() is called when the task has been unpaused by the TaskTree.
Implemented in DustyEngine::DummyTask. |
|
|
|
RemoveChild() removes a child from this task's list of children. This is called automatically when the TaskTree destroys a child.
|
|
|
SetCreationTime() sets the time at which this task was created. It is called automatically by the TaskTree's AddTask() function.
|
|
|
SetTimeServerEntry() sets a pointer to the time server entry that this task should use for all its time-delta functions. This is called automatically by TaskTree's AddTask() function.
|
|
|
SetDustyDriver() tells the task a pointer to the DustyDriver. This is called automatically by TaskTree in the AddTask() function.
|
|
|
Say you have a task whose priority is 100 milliseconds. Then the TaskTree tries to update, and it turns out that 1000 milliseconds have passed since the task was last updated. This allows you to have the task update 10 times to make up the slack, or to only update once no matter how much time has passed. |
|
|
SetIrrlichtDevice() tells the task the irrlicht device it should use. This is called automatically by TaskTree() in the AddTask() function.
|
|
|
SetLifeTimeExecutions() will set the number of times this task should be executed by the TaskTree before it is destroyed. This is called automatically by TaskTree's AddTask() function.
|
|
|
SetLifetimeMS() will set the number of milliseconds this task should exist before being destroyed by the TaskTree. This is called automatically by TaskTree's AddTask() function.
|
|
|
SetNumExecutions() allows you to set the number of times this task has executed. This is set to 0 by TaskTree's AddTask() function.
|
|
|
SetParent() sets the parent task of this task. This is called automatically by TaskTree's AddTask() function.
|
|
|
SetPaused() will set whether or not the task is paused. This does NOT correctly pause the task. Pausing should be done by the TaskTree. This is called automatically by TaskTree's Pause()/UnPause()/AddTask() functions.
|
|
|
SetPausedDelta() is used by TaskTree to set the time-delta of the task at the moment the task was paused. This is what allows for seamless unpausing, because the task will be restored to the same time-delta after it's unpaused. This is called automatically by TaskTree's PauseTask() function.
|
|
|
|
|
|
SetPriority() sets the amount of time (in milliseconds) between executions of the task. This is called automatically by TaskTree's AddTask() function.
|
|
|
Sets the string tag associated with this task. The tag is for external use only, it is not used by Dusty Engine.
|
|
|
Sets the amount of time that this task should stay paused when it is paused by the task tree. If this value is not 0, then it represents the number of milliseconds the task will stay paused. After that time has passed, the task tree will automatically unpause it. If the value is 0, the task stays paused until manually unpaused.
|
|
|
Sets the amount of time this task should be allowed to run when it has been unpaused by the task tree. If this value is not 0, then the task tree will automatically pause the task after this time in milliseconds has passed. If the value is 0, then the task will stay paused until manually unpaused.
|
|
|
SetTotalTimeDelta() sets the total amount of time-delta time this task has had. This is called automatically by TaskTree()'s OnUpdate() function.
|
|
|
Definition at line 271 of file dustytask.h. |
|
|
Definition at line 256 of file dustytask.h. |
|
|
Definition at line 269 of file dustytask.h. |
|
|
Definition at line 247 of file dustytask.h. |
|
|
Definition at line 265 of file dustytask.h. |
|
|
Definition at line 246 of file dustytask.h. |
|
|
Definition at line 254 of file dustytask.h. |
|
|
Definition at line 255 of file dustytask.h. |
|
|
Definition at line 252 of file dustytask.h. |
|
|
Definition at line 267 of file dustytask.h. |
|
|
Definition at line 264 of file dustytask.h. |
|
|
Definition at line 253 of file dustytask.h. |
|
|
Definition at line 259 of file dustytask.h. |
|
|
Definition at line 251 of file dustytask.h. |
|
|
Definition at line 249 of file dustytask.h. |
|
|
Definition at line 261 of file dustytask.h. |
|
|
Definition at line 262 of file dustytask.h. |
|
|
Definition at line 257 of file dustytask.h. |
1.4.6-NO