Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

ExManagerCommand.h

Go to the documentation of this file.
00001 /*
00002  * ExNihilo 3D Engine
00003  * 
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  *
00018  * Please read AUTHORS file !!!
00019  * 
00020  * $Id: ExManagerCommand.h,v 1.9 2002/08/01 18:45:56 data Exp $
00021  *
00022  */
00023 
00024 #ifndef __EXMANAGERCOMMAND_H__
00025 #define __EXMANAGERCOMMAND_H__
00026 //--------------------------------
00027 // File to include
00028 //--------------------------------
00029 #include "ExDefine.h"
00030 #include "ExMath.h"
00031 #include "ExManagerMap.h"
00032 #include "ExManagerFog.h"
00033 #include "ExManagerAnimation.h"
00034 #include "ExManagerWindow.h"
00035 #include "ExManagerEntite.h"
00036 #include "ExManagerGizmo.h"
00037 #include "ExManagerLight.h"
00038 #include "ExManagerCam.h"
00039 #include "ExManagerParticuleSystem.h"
00040 #include "ExManagerTexture.h"
00041 #include "ExManagerPVS.h"
00042 #include "ExManagerCollision.h"
00043 #include "ExManagerId.h"
00044 #include "ExManagerMenu.h"
00045 #include "ExManagerInterface.h"
00046 #include "ExManagerConsole.h"
00047 #include "ExManagerSound.h"
00048 #include "ExManagerSpirit.h"
00049 #include "InputActionList.h"
00050 #include "ExCFile.h"
00051 //--------------------------------
00052 class ExManagerCommand
00053 {
00054 private:
00055 //--------------------------------
00056 // Variable
00057 //--------------------------------
00058         ExManagerMenu                           *ManagerMenu;
00059         ExManagerMap                            *ManagerMap;    
00060         ExManagerFog                            *ManagerFog;
00061         ExManagerAnimation                      *ManagerAnim;
00062         ExManagerWindow                         *ManagerWindow;
00063         ExManagerEntite                         *ManagerEntite;
00064         ExManagerGizmo                          *ManagerGizmo;
00065         ExManagerLight                          *ManagerLight;
00066         ExManagerCam                            *ManagerCam;
00067         ExManagerParticuleSystem        *ManagerParticuleSystem;
00068         ExManagerTexture                        *ManagerTexture;
00069         ExManagerPVS                            *ManagerPVS;
00070         ExManagerCollision                      *ManagerCollision;
00071         ExManagerId                                     *ManagerId      ;
00072         ExManagerInterface                      *ManagerInterface;
00073         ExManagerConsole                        *ManagerConsole;
00074         ExManagerSpirit                         *ManagerSpirit;
00075         ExManagerSound                          *ManagerSound;
00076 
00077         int             m_MousePosX;
00078         int             m_MousePosY;    
00079 
00080         typedef std::pair<int,SAction> CommandAction;
00081         std::vector<CommandAction>                              m_VecCommand;
00082         std::vector<CommandAction>::iterator    m_ItVecCommand;
00083 
00084         std::vector<SAction>                    m_VecAction;
00085         std::vector<SAction>::iterator  m_ItVecAction;
00086         std::vector<SAction>                    m_VecTempAction;//action added when action run
00087 
00088         std::vector<SAction>                    m_VecRepAction;
00089         std::vector<SAction>::iterator  m_ItVecRepAction;
00090 
00091         void RemoveRepAction(SAction action);
00092         void AddRepAction(SAction action);
00093         void AddAction(SAction action);
00094         void AddCommandAction (ExCFileDataAction);
00095         void AddCommandAction(int command,SAction action);
00096         void AddCommandAction(int command,int action,char *param);
00097         void AddCommandAction(CommandAction ComAct); 
00098         void ProcessCommand(int command);
00099         bool ProcessAction(SAction action);
00100 
00101         bool LogCommand;
00102         ofstream logfilecommand;
00103 public:
00104 //--------------------------------
00105 // Constructor // Destructor
00106 //--------------------------------
00107         ExManagerCommand(void);
00108         ~ExManagerCommand(void);
00109 //--------------------------------
00110 // Methode
00111 //--------------------------------
00112         void AddNewAction(SAction action);
00113         void Reset(void);
00114         std::ostrstream *Consol;
00115         void (*WriteToConsol)(const char *Label);
00116 
00117         inline void SetManagerMap(ExManagerMap *Map){ManagerMap = Map;}
00118         inline void SetManagerFog(ExManagerFog *Fog){ManagerFog = Fog;}
00119         inline void SetManagerAnim(ExManagerAnimation *Anim){ManagerAnim = Anim;}
00120         inline void SetManagerWindow(ExManagerWindow *Window){ManagerWindow = Window;}
00121         inline void SetManagerEntite(ExManagerEntite *Entite){ManagerEntite = Entite;}
00122         inline void SetManagerGizmo(ExManagerGizmo *Gizmo){ManagerGizmo = Gizmo;}
00123         inline void SetManagerLight(ExManagerLight *Light){ManagerLight = Light;}
00124         inline void SetManagerCam(ExManagerCam *Cam){ManagerCam = Cam;}
00125         inline void SetManagerParticuleSystem(ExManagerParticuleSystem *ParticuleSystem){ManagerParticuleSystem = ParticuleSystem;}
00126         inline void SetManagerTexture(ExManagerTexture * Texture){ManagerTexture = Texture;}
00127         inline void SetManagerPVS(ExManagerPVS * PVS){ManagerPVS = PVS;}
00128         inline void SetManagerCollision(ExManagerCollision *Collision){ManagerCollision = Collision;}
00129         inline void SetManagerId(ExManagerId *Id){ManagerId     = Id;}
00130         inline void SetManagerMenu(ExManagerMenu * Menu){ManagerMenu=Menu;}
00131         inline void SetManagerInterface(ExManagerInterface * Interface){ManagerInterface=Interface;}
00132         inline void SetManagerConsole(ExManagerConsole * Console){ManagerConsole=Console;}
00133         inline void SetManagerSound(ExManagerSound * Sound){ManagerSound=Sound;}
00134         inline void SetManagerSpirit(ExManagerSpirit * Spirit){ManagerSpirit=Spirit;}
00135 
00136         void Init(void);
00137         bool LoadCommandFile(const char *FileName);
00138         bool LoadExecFile(SAction *action);
00139         bool LoadFile(const char *FileName);
00140 
00141         void InputCommand(int command);
00142         void ApplyAction(void);
00143 
00144         inline void SetMousePosition(int posx,int posy){m_MousePosX=posx;m_MousePosY=posy;}
00145         void LoadSetOfFile(const char *FileName);
00146 //--------------------------------
00147 // Operator
00148 //--------------------------------
00149 //--------------------------------
00150 // friends
00151 //--------------------------------
00152 };
00153 #endif //__EXMANAGERCOMMAND_H__

Generated on Tue Aug 6 20:27:12 2002 for ExNihilo by doxygen1.2.17