1 // Kernel.h: interface for the CKernel class.
\r
3 //////////////////////////////////////////////////////////////////////
\r
5 #if !defined(AFX_KERNEL_H__4E822B7D_1078_4F70_BC8F_3BB4F83ED0AF__INCLUDED_)
\r
6 #define AFX_KERNEL_H__4E822B7D_1078_4F70_BC8F_3BB4F83ED0AF__INCLUDED_
\r
10 #endif // _MSC_VER > 1000
\r
12 #include "singleton.h"
\r
13 #include "SpriteManager.h"
\r
21 class CKernel : public Singleton<CKernel>
\r
29 bool AddTask(const CMMPointer<ITask> &t);
\r
30 void SuspendTask(const CMMPointer<ITask> &t);
\r
31 void ResumeTask(const CMMPointer<ITask> &t);
\r
32 void RemoveTask(const CMMPointer<ITask> &t);
\r
33 void KillAllTasks();
\r
35 void setSpriteManager(CSpriteManager*) {this->sm = sm;}
\r
36 CSpriteManager* getSpriteManager() {return this->sm;}
\r
38 std::list< CMMPointer<ITask> > taskList;
\r
39 std::list< CMMPointer<ITask> > pausedTaskList;
\r
43 class ITask : public IMMObject
\r
46 ITask(){canKill=false;priority=5000;}
\r
47 virtual bool Start()=0;
\r
48 virtual void OnSuspend(){};
\r
49 virtual void Update()=0;
\r
50 virtual void OnResume(){};
\r
51 virtual void Stop()=0;
\r
57 #endif // !defined(AFX_KERNEL_H__4E822B7D_1078_4F70_BC8F_3BB4F83ED0AF__INCLUDED_)
\r