C:/Users/Mike/Documents/Visual Studio Projects/GameEngine/include/Process.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 Copyright (C) 2006 Michael Harnetty
00004 
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018 -----------------------------------------------------------------------------
00019 */
00020 
00021 #ifndef PROCESS_H
00022 #define PROCESS_H
00023 
00024 #include "GameEnginePrerequisites.h"
00025 
00026 namespace GameEngine {
00027         
00028         enum PROCESS_TYPE
00029         {
00030                 PROC_NONE,
00031                 PROC_CONTROL,
00032                 PROC_SCREEN,
00033                 PROC_MUSIC,
00034                 PROC_OBJECTMOVEMENT
00035         };
00036 
00037 
00040         class ENGINE_DECL Process
00041         {
00042                 friend class ProcessManager;
00043 
00044         public:
00048                 virtual bool isDead() const { return mKill; }
00049 
00053                 virtual bool isActive() const { return mActive; }
00054 
00058                 virtual void setActive(const bool active) { mActive = active; }
00059                 
00063                 virtual bool isAttached() const;
00064 
00068                 virtual bool isPaused() const { return mPaused; }
00069 
00070 
00073                 virtual void togglePause() { mPaused = !mPaused; }
00074 
00075                 bool isInitialised() const { return mIsInitialised; }
00076 
00080                 boost::shared_ptr<Process> getNext() const { return mNext; }
00081 
00085                 virtual void setNext(boost::shared_ptr<Process> next);
00086 
00087 
00092                 virtual void update(const double& dt) {}
00093 
00098                 virtual bool init() { mIsInitialised = true; setActive(true); return true; }
00099 
00102                 virtual void destroy() { kill(); }
00103 
00104 
00105         protected:
00106                 bool mKill;
00107                 bool mActive;
00108                 bool mPaused;
00109                 bool mIsAttached;
00110                 bool mIsInitialised;
00111                 boost::shared_ptr<Process> mNext;
00112 
00113 
00118                 virtual void setAttached(const bool attach);
00119 
00120 
00124                 virtual void kill();
00125         };
00126 
00127 }
00128 
00129 #endif

Generated on Thu Apr 19 09:47:02 2007 for GameEngine by  doxygen 1.5.2