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

# ExManagerCommand.h

Go to the documentation of this file.

    00001 /************************************************************************/
    00002 /* Ex Nihlo Engine by Hermanns Christophe                                                               */
    00003 /************************************************************************/
    00004 /* This program is free software; you can redistribute it and/or                */
    00005 /* modify it under the terms of the GNU General Public License                  */
    00006 /* as published by the Free Software Foundation; either version 2               */
    00007 /* of the License, or (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.                                 */
    00012 /*                                                                                                                                              */
    00013 /* See the 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., 59 Temple Place - Suite 330,                                               */
    00018 /* Boston, MA  02111-1307, USA.                                                                                 */
    00019 /*                                                                                                                                              */
    00020 /* If you use a important part of this code please send me a mail               */
    00021 /* I just want to see where my code go thks :)                                                  */
    00022 /************************************************************************/
    00023
    00024 /************************************************************************/
    00025 /* Contact                                                              */
    00026 /************************************************************************/
    00027 /* ExNihilo Website :www.ploksoftware.org                               */
    00028 /*                                                                      */
    00029 /* Hermanns Christophe ExNihilo creator and main programmer             */
    00030 /*                                                                      */
    00031 /* Mail             : Data@ploksoftware.org                                                             */
    00032 /* ICQ              : 8030901                                                                                   */
    00033 /* MSN Messenger    : Data_7@hotmail.com                                                                */
    00034 /*                                                                      */
    00035 /* Benjamin Michotte Linux port, webmaster                              */
    00036 /*                                                                      */
    00037 /* Mail             :binny@ploksoftware.org                             */
    00038 /*                                                                      */
    00039 /************************************************************************/
    00040
    00041 /************************************************************************/
    00042 /* File Description                                                                                             */
    00043 /************************************************************************/
    00044 /* File Name   :InputActionList.h                                                                               */
    00045 /*                                                                                                                                              */
    00046 /* Star Date   :03/15/2002                                                                                              */
    00047 /*                                                                                                                                              */
    00048 /* Last Update :
    00049  * $Id: ExManagerCommand.h,v 1.18 2002/11/24 11:58:53 data Exp $
    00050  *
    00051  */
    00052
    00053 #ifndef __EXMANAGERCOMMAND_H__
    00054 #define __EXMANAGERCOMMAND_H__
    00055 //--------------------------------
    00056 // File to include
    00057 //--------------------------------
    00058 #include "ExDefine.h"
    00059 #include "ExMath.h"
    00060 #include "ExManagerMap.h"
    00061 #include "ExManagerFog.h"
    00062 #include "ExManagerAnimation.h"
    00063 #include "ExManagerWindow.h"
    00064 #include "ExManagerGizmo.h"
    00065 #include "ExManagerLight.h"
    00066 #include "ExManagerParticuleSystem.h"
    00067 #include "ExManagerTexture.h"
    00068 #include "ExManagerCollision.h"
    00069 #include "ExManagerId.h"
    00070 #include "ExManagerMenu.h"
    00071 #include "ExManagerInterface.h"
    00072 #include "ExManagerConsole.h"
    00073 #include "ExManagerSound.h"
    00074 #include "ExManagerSpirit.h"
    00075
    00076 #include "ExManager.h"
    00077 #include "ExCFile.h"
    00078 #include "ExCFile2.h"
    00079 #include "ExManagerCamera.h"
    00080 #include "ExManagerModele.h"
    00081 #include "ExManagerNetwork.h"
    00082 #include "ExCCommand.h"
    00083 #include "ExCAction.h"
    00084 //--------------------------------
    00085 class ExManagerCommand : public ExManager
    00086 {
    00087 private:
    00088 //--------------------------------
    00089 // Variable
    00090 //--------------------------------
    00091         ExManagerMenu                           *ManagerMenu;
    00092         ExManagerMap                            *ManagerMap;
    00093         ExManagerFog                            *ManagerFog;
    00094         ExManagerAnimation                      *ManagerAnim;
    00095         ExManagerWindow                         *ManagerWindow;
    00096         ExManagerGizmo                          *ManagerGizmo;
    00097         ExManagerLight                          *ManagerLight;
    00098         ExManagerParticuleSystem        *ManagerParticuleSystem;
    00099         ExManagerTexture                        *ManagerTexture;
    00100         ExManagerCollision                      *ManagerCollision;
    00101         ExManagerId                                     *ManagerId      ;
    00102         ExManagerInterface                      *ManagerInterface;
    00103         ExManagerConsole                        *ManagerConsole;
    00104         ExManagerSpirit                         *ManagerSpirit;
    00105         ExManagerSound                          *ManagerSound;
    00106         ExManagerCamera                         *ManagerCamera;
    00107         ExManagerModel                          *ManagerModel;
    00108         ExManagerNetwork                        *ManagerNetwork;
    00109         int             m_MousePosX;
    00110         int             m_MousePosY;
    00111
    00112         typedef std::pair<ExCCommand,ExCAction> CommandAction;
    00113         std::vector<CommandAction>                              m_VecCommand;
    00114         std::vector<CommandAction>::iterator    m_ItVecCommand;
    00115
    00116         std::vector<ExCAction>                  m_VecAction;
    00117         std::vector<ExCAction>::iterator        m_ItVecAction;
    00118         std::vector<ExCAction>                  m_VecTempAction;//action added when action run
    00119
    00120         std::vector<ExCAction>                  m_VecRepAction;
    00121         std::vector<ExCAction>::iterator        m_ItVecRepAction;
    00122
    00123         void RemoveRepAction(ExCAction action);
    00124         void AddRepAction(ExCAction action);
    00125         void AddAction(ExCAction action);
    00126         void AddCommandAction (ExCFileDataAction);
    00127         void AddCommandAction(int command,ExCAction action);
    00128         void AddCommandAction(int command,int action,std::string param);
    00129         void AddCommandAction(CommandAction ComAct);
    00130         void ProcessCommand(ExCCommand command);
    00131         bool ProcesExCAction(ExCAction action);
    00132
    00133         bool LogCommand;
    00134         ofstream logfilecommand;
    00135         bool plok;
    00136 //--------------------------------
    00137 // Singleton creation
    00138 //--------------------------------
    00139         static bool m_flag;
    00140         static ExManagerCommand *m_instance;
    00141         ExManagerCommand(void);
    00142         ~ExManagerCommand(void);
    00143 //--------------------------------
    00144 public:
    00145 //--------------------------------
    00146 // Methode
    00147 //--------------------------------
    00148         static ExManagerCommand*  CreateSingleton(void);
    00149         void AddNewAction(ExCAction action);
    00150         void Reset(void){return;}
    00151
    00152         inline void SetManagerMap(ExManagerMap *Map){ManagerMap = Map;}
    00153         inline void SetManagerFog(ExManagerFog *Fog){ManagerFog = Fog;}
    00154         inline void SetManagerAnim(ExManagerAnimation *Anim){ManagerAnim = Anim;}
    00155         inline void SetManagerWindow(ExManagerWindow *Window){ManagerWindow = Window;}
    00156         inline void SetManagerGizmo(ExManagerGizmo *Gizmo){ManagerGizmo = Gizmo;}
    00157         inline void SetManagerLight(ExManagerLight *Light){ManagerLight = Light;}
    00158         inline void SetManagerParticuleSystem(ExManagerParticuleSystem *ParticuleSystem){ManagerParticuleSystem = ParticuleSystem;}
    00159         inline void SetManagerTexture(ExManagerTexture * Texture){ManagerTexture = Texture;}
    00160         inline void SetManagerCollision(ExManagerCollision *Collision){ManagerCollision = Collision;}
    00161         inline void SetManagerId(ExManagerId *Id){ManagerId     = Id;}
    00162         inline void SetManagerMenu(ExManagerMenu * Menu){ManagerMenu=Menu;}
    00163         inline void SetManagerInterface(ExManagerInterface * Interface){ManagerInterface=Interface;}
    00164         inline void SetManagerConsole(ExManagerConsole * Console){ManagerConsole=Console;}
    00165         inline void SetManagerSound(ExManagerSound * Sound){ManagerSound=Sound;}
    00166         inline void SetManagerSpirit(ExManagerSpirit * Spirit){ManagerSpirit=Spirit;}
    00167
    00168         inline void SetManagerCamera(ExManagerCamera *Cam){ManagerCamera = Cam;}
    00169         inline void SetManagerModel(ExManagerModel *Model){ManagerModel = Model;}
    00170         inline void SetManagerNetwork(ExManagerNetwork *Network){ManagerNetwork = Network;}
    00171
    00172         void Init(void);
    00173         bool LoadCommandFile(std::string FileName);
    00174         //bool LoadExecFile(ExCAction *action);
    00175         bool LoadFile(std::string FileName);
    00176
    00177         void InputCommand(int command);
    00178         ExCAction InputCommand(ExCCommand Command);
    00179         void ApplyAction(void);
    00180
    00181         inline void SetMousePosition(int posx,int posy){m_MousePosX=posx;m_MousePosY=posy;}
    00182
    00183         void LoadSetOfFile(const char *FileName);
    00184         void LoadExecFile(std::string FileName);
    00185
    00186         void DisplayFileType(void);
    00187
    00188         ExCAction InputAction(ExCAction Action);
    00189 //--------------------------------
    00190 // Operator
    00191 //--------------------------------
    00192 //--------------------------------
    00193 // friends
    00194 //--------------------------------
    00195 };
    00196 #endif //__EXMANAGERCOMMAND_H__