D:/simple_rts/include/GameListener.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <set>
00004 
00005 #include "Updater.h"
00006 
00007 #include "OgreFrameListener.h"
00008 #include "OgreSingleton.h"
00009 
00010 using std::set;
00011 using Ogre::FrameEvent;
00012 using Ogre::FrameListener;
00013 using Ogre::InputReader;
00014 using Ogre::RenderWindow;
00015 using Ogre::Singleton;
00016 
00017 
00018 namespace ASR
00019 {
00020         class Timer;
00021 
00022         // ----------------------------------------------------------------------------
00023         class GameListener : public FrameListener, Singleton<GameListener>
00024         {
00025         // Data Storage
00026         // ----------------------------------------------------------------------------
00027         private:
00028                 typedef set<Updater*>           UpdaterList;
00029                 UpdaterList                                     mUpdaterList;
00030                 UpdaterList                                     mUpdatersToRemove;
00031 
00032                 InputReader*                            mInputDevice;
00033                 RenderWindow*                           mWindow;
00034 
00035                 Timer*                                          mTimer;
00036 
00037         // Construction
00038         // ----------------------------------------------------------------------------
00039         public:
00040                 GameListener( RenderWindow* win );
00041                 ~GameListener(void);
00042 
00043         // Frame Updates
00044         // ----------------------------------------------------------------------------
00045         public:
00046                 bool frameStarted ( const FrameEvent& e );
00047                 bool frameEnded ( const FrameEvent& e );
00048 
00049 
00050         // Updater Hooking
00051         // ----------------------------------------------------------------------------
00052         public:
00053                 void addUpdater ( Updater* updateListener );
00054                 void removeUpdater ( Updater* updateListener );
00055         };
00056 }

Generated on Sun Jun 25 19:23:43 2006 for Valors End by  doxygen 1.4.7