Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

IEventManager.h

Go to the documentation of this file.
00001 // mortic - A game engine for the Expanses of Naryan.
00002 // Copyright (C) 2007  Aaron Griffith
00003 // This file is under the LGPL. See mortic.h for more information.
00004 
00006 //  ______               _   __  __                                           //
00007 // |  ____|             | | |  \/  |                                          //
00008 // | |____   _____ _ __ | |_| \  / | __ _ _ __   __ _  __ _  ___ _ __         //
00009 // |  __\ \ / / _ \ '_ \| __| |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|        //
00010 // | |___\ V /  __/ | | | |_| |  | | (_| | | | | (_| | (_| |  __/ |           //
00011 // |______\_/ \___|_| |_|\__|_|  |_|\__,_|_| |_|\__,_|\__, |\___|_|           //
00012 //                                                     __/ |                  //
00013 //                                                    |___/                   //
00014 // IEventManager.h - Interface of EventManager                                //
00016 
00017 #ifndef __IEventManager_h_INCLUDED__
00018 #define __IEventManager_h_INCLUDED__
00019 
00020 #include "IRoot.h"
00021 #include "IObject.h"
00022 #include <string>
00023 #include "irrlicht.h"
00024 
00025 namespace mortic
00026 {
00028         
00032     enum EEventType
00033     {
00034         EET_NULL, 
00035         EET_MORTIC, 
00036         EET_USER, 
00037         EET_IRRLICHT 
00038     };
00039 
00041         
00046     enum EValueType
00047     {
00048         EVT_OBJECT, 
00049         EVT_STRING, 
00050         EVT_INTEGER, 
00051         EVT_FLOATINGPOINT, 
00052         EVT_NONE 
00053     };
00054         
00056         
00059     union UValue
00060     {
00061         IObject* object; 
00062         std::string* string; 
00063         int integer; 
00064         float floatingpoint; 
00065 
00066         bool fakeflag; 
00067     };
00068         
00070         
00074     class IEvent : public IObject
00075     {
00076     public:
00078         IEvent(IRoot* root) : IObject(root, "Event")
00079         { }
00081         virtual ~IEvent()
00082         { }
00083                 
00085                 
00091         virtual enum EEventType getEventType() = 0;
00092 
00094         
00100         virtual unsigned int getCount() = 0;
00101         
00103         
00108         virtual enum EValueType getValueType(unsigned int i) = 0;
00109         
00111         
00117         virtual union UValue getValue(unsigned int i) = 0;
00118         
00120         
00123         virtual std::string getEventName() = 0;
00124 
00125         // EET_IRRLICHT
00127         
00130         virtual irr::SEvent getIrrlichtEvent() = 0;
00131     };
00132         
00134         
00141     class IEventManager : public IObject
00142     {
00143     public:
00145         IEventManager(IRoot* root) : IObject(root, "EventManager")
00146         { }
00148         virtual ~IEventManager()
00149         { }
00150                 
00152                 
00157         virtual void generateIrrlichtEvent(irr::SEvent event) = 0;
00158         
00160         
00165         virtual void generateMorticEvent(std::string name,
00166                                                                                  enum EValueType* types = NULL,
00167                                          union UValue* values = NULL,
00168                                          unsigned int count = 0) = 0;
00169         
00171         
00179         virtual void generateUserEvent(std::string name,
00180                                                                                  enum EValueType* types = NULL,
00181                                          union UValue* values = NULL,
00182                                          unsigned int count = 0) = 0;
00183                                          
00185         
00189                 virtual void generateNullEvent() = 0;
00190     };
00191 
00192 }
00193 ; // namespace mortic
00194 #endif // __IEventManager_h_INCLUDED__

Generated on Sat Dec 30 21:21:59 2006 for mortic by  doxygen 1.4.4