dustytask.h

Go to the documentation of this file.
00001 /*
00002 Dusty Engine Library
00003 by Dave Andrews
00004 
00005 Dusty Engine is a task engine using the Irrlicht (irrlicht.sourceforge.net)
00006 3d Engine, by Nikolaus Gebhardt.
00007 
00008 This software is released on the zlib license.  Contents of that license follow.
00009 
00010   Copyright (C) 2005 Dave Andrews
00011 
00012   This software is provided 'as-is', without any express or implied
00013   warranty.  In no event will the authors be held liable for any damages
00014   arising from the use of this software.
00015 
00016   Permission is granted to anyone to use this software for any purpose,
00017   including commercial applications, and to alter it and redistribute it
00018   freely, subject to the following restrictions:
00019 
00020   1. The origin of this software must not be misrepresented; you must not
00021      claim that you wrote the original software. If you use this software
00022      in a product, an acknowledgment in the product documentation would be
00023      appreciated but is not required.
00024   2. Altered source versions must be plainly marked as such, and must not be
00025      misrepresented as being the original software.
00026   3. This notice may not be removed or altered from any source distribution.
00027 
00028   Dave Andrews (dave@daveandrews.org)
00029 */
00030 
00031 #ifndef __DUSTY_TASK_H__
00032 #define __DUSTY_TASK_H__
00033 
00034 #include <irrlicht.h>
00035 #include "dustyengine.h"
00036 
00037 namespace DustyEngine
00038 {
00039         class DustyDriver;
00040         class DeltaTimer;
00041 
00043 
00051         class DUSTYENGINE_API Task : public irr::IUnknown
00052         {
00053         public:
00055                 Task();
00056 
00057                 virtual ~Task();
00058 
00060                 virtual void OnCreation() = 0;
00061 
00063                 virtual void OnDestruction() = 0;
00064 
00066                 virtual void OnPause() = 0;
00067 
00069                 virtual void OnUnpause() = 0;
00070 
00072 
00076                 virtual void OnUpdate() = 0;
00077 
00080                 virtual void OnAddChild(Task * child) = 0;
00081 
00084                 virtual void OnRemoveChild(Task * child) = 0;
00085 
00087                 virtual void OnLifetimeExpired() = 0;
00088 
00090                 virtual void OnChildrenPaused() = 0;
00091 
00093                 virtual void OnChildrenUnpaused() = 0;
00094 
00097                 void SetDustyDriver(DustyDriver * dd);
00098 
00101                 DustyDriver * GetDustyDriver();
00102 
00105                 void SetIrrlichtDevice(irr::IrrlichtDevice * device);
00106 
00109                 irr::IrrlichtDevice * GetIrrlichtDevice();
00110 
00113                 void SetPriority(irr::u32 p);
00114 
00117                 irr::u32 GetPriority();
00118 
00121                 void SetPaused(bool p);
00122 
00125                 bool IsPaused();
00126 
00129                 void SetParent(Task * p);
00130 
00133                 Task * GetParent();
00134 
00137 
00142                 void SetExecuteMultiple(bool execute);
00143 
00146                 bool GetExecuteMultiple();
00147 
00150                 void SetNumExecutions(irr::u32 n);
00151 
00154                 irr::u32 GetNumExecutions();
00155 
00158                 void SetDeltaTimer(DeltaTimer * entry);
00159 
00162                 DeltaTimer * GetDeltaTimer();
00163 
00166                 void SetPauseDelta(irr::u32 pd);
00167 
00170                 irr::u32 GetPauseDelta();
00171 
00174                 void SetLifetimeExecutions(irr::u32 lt);
00175 
00178                 irr::u32 GetLifetimeExecutions();
00179 
00182                 void SetLifetimeMS(irr::u32 lt);
00183 
00186                 irr::u32 GetLifetimeMS();
00187 
00190                 void SetCreationTime(irr::u32 ct);
00191 
00194                 irr::u32 GetCreationTime();
00195 
00198                 void SetTotalTimeDelta(irr::u32 ttd);
00199 
00202                 irr::u32 GetTotalTimeDelta();
00203                 
00204                 void SetPauseUnpauseTime(irr::u32 t);
00205                 
00206                 irr::u32 GetPauseUnpauseTime();
00207                 
00209                 void SetTimeToStayPaused(irr::u32 t);
00210 
00212                 irr::u32 GetTimeToStayPaused();
00213                 
00215                 void SetTimeToStayUnpaused(irr::u32 t);
00216                 
00218                 irr::u32 GetTimeToStayUnpaused();
00219 
00222                 void AddChild(Task * child);
00223 
00225                 void ClearChildren();
00226 
00229                 void RemoveChild(Task * child);
00230 
00233                 irr::core::list<Task*> * GetChildren();
00234 
00237                 irr::u32 NumChildren();
00238 
00240                 void SetTag(irr::core::stringc t);
00241 
00243                 irr::core::stringc GetTag();
00244 
00245         protected:
00246                 irr::IrrlichtDevice * irrlichtDevice;
00247                 DustyDriver * dustyDriver;
00248 
00249                 irr::core::stringc tag;
00250 
00251                 irr::u32 priority;
00252                 irr::u32 numExecutions;
00253                 irr::u32 pauseDelta;
00254                 irr::u32 lifetimeExecutions;
00255                 irr::u32 lifetimeMS;
00256                 irr::u32 creationTime;
00257                 irr::u32 totalTimeDelta;
00258 
00259                 irr::u32 pauseUnpauseTime;
00260                 
00261                 irr::u32 timeToStayPaused;
00262                 irr::u32 timeToStayUnpaused;
00263 
00264                 bool paused;
00265                 bool executeMultiple;
00266 
00267                 Task * parent;
00268 
00269                 DeltaTimer * deltaTimer;
00270 
00271                 irr::core::list<Task *> children;
00272         };
00273 }
00274 
00275 #endif
00276 

Generated on Fri Jan 27 17:31:51 2006 for Dusty Engine by  doxygen 1.4.6-NO