Page principale Liste des namespaces Hiérarchie des classes Liste par ordre alphabétique Liste des composants Liste des fichiers Membres des namespaces Composants Déclarations

# ExManagerConsole.h

Aller à la documentation de ce fichier.

    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: ExManagerConsole.h,v 1.20 2002/10/15 09:17:13 data Exp $
    00050  *
    00051  */
    00052
    00053 #ifndef __EXMANAGERCONSOLE_H__
    00054 #define __EXMANAGERCONSOLE_H__
    00055 //--------------------------------
    00056 // File to include
    00057 //--------------------------------
    00058 #include "ExDefine.h"
    00059 #include "ExMath.h"
    00060 #include "ExNihiloNameSpace.h"
    00061 #include "ExCFile.h"
    00062 //--------------------------------
    00063 #include "ExCCommand.h"
    00064 #include "ExCAction.h"
    00065 //--------------------------------
    00066 #include "ExManager.h"
    00067 #include "ExManagerWindow.h"
    00068 #include "ExManagerTexture.h"
    00069 #include <stdarg.h>
    00070 //--------------------------------
    00071 #define HIDE            0
    00072 #define HALF            1
    00073 #define FULL            2
    00074 #define HIDETOHALF      3
    00075 #define HIDETOFULL  4
    00076 #define HALFTOFULL      5
    00077 #define FULLTOHALF      6
    00078 #define FULLTOHIDE      7
    00079 #define HALFTOHIDE      8
    00080
    00081 #define PREDIFINEDCOMMAND 10
    00082 //--------------------------------
    00083 class ExManagerConsole   : public ExManager
    00084 {
    00085 private:
    00086 //--------------------------------
    00087 // Variable
    00088 //--------------------------------
    00089         ExManagerWindow                 *ManagerWindow;
    00090         ExManagerTexture                *ManagerTexture;
    00091         int                                             m_ConsoleState; //HIDE,HALF,FULL
    00092         int                                             m_LineCounter;
    00093         int                                             m_ConsoleTrans;
    00094         int                                             m_NextConsoleState;
    00095         int                                             m_ConsoleTransPalier;
    00096         bool                                    console_move;
    00097         int                                             m_Move;
    00098
    00099         std::string                                     m_BackGroundTexture;
    00100
    00101         std::string                                                                     m_BuffCommand;
    00102         std::vector<std::string>                                        m_BuffOldCommand;
    00103
    00104         int PosIntoBuffOldCommand;
    00105
    00106         typedef std::pair<std::string,int>                      StringAction;
    00107     std::vector<StringAction>                                   m_VecStringAction;
    00108         std::vector<StringAction>::iterator                     m_ItVecStringAction;
    00109
    00110         std::vector<std::string>                                                m_BufferConsol;
    00111         std::vector<std::string>::reverse_iterator              m_RItBufferConsol;
    00112         std::vector<std::string>::iterator                              m_ItBufferConsol;
    00113
    00114         ofstream logfilecsl;
    00115
    00116         bool                                    LogConsol;
    00117         bool                                    m_BackGroundTextureState;
    00118         bool                                    m_Blending;
    00119         float                   m_fBlending;
    00120         float                   m_fBackGroundBlue;
    00121         float                   m_fBackGroundRed;
    00122         float                   m_fBackGroundGreen;
    00123         int                                             m_LineToStar;
    00124         int                                             m_LineInConsol;
    00125 //--------------------------------
    00126 // Methode
    00127 //--------------------------------
    00128         void AddStringAction(std::string String,int Action);
    00129         void AddStringAction(StringAction StrAction);
    00130         void AddStringAction(ExCFileDataAction);
    00131         ExCAction ApplyBuffCommand(void);
    00132         void WriteInDaFile (std::string str);
    00133 //--------------------------------
    00134 // Singleton creation
    00135 //--------------------------------
    00136         static bool m_flag;
    00137         static ExManagerConsole *m_instance;
    00138         ExManagerConsole(void);
    00139         ~ExManagerConsole(void);
    00140 //--------------------------------
    00141 public:
    00142 //--------------------------------
    00143 // Methode
    00144 //--------------------------------
    00145         static ExManagerConsole*  CreateSingleton(void);
    00146
    00147         inline void SetManagerWindow(ExManagerWindow *Window){ManagerWindow = Window;}
    00148         inline void SetManagerTexture(ExManagerTexture *Texture){ManagerTexture = Texture;}
    00149
    00150         void ClearConsol(void);
    00151         void Reset(void);
    00152         void Write (const char *);
    00153         void Draw(void);
    00154
    00155         void Init(void);
    00156         int NextAviableState(void);
    00157         void SetConsoleState(int state);
    00158         int GetConsoleState (void) { return m_ConsoleState; }
    00159         void ConsoleMove (bool);
    00160         bool isConsoleMove (void) { return console_move; }
    00161         void SetConsoleBackGroudTexture(std::string     FileName);
    00162         inline void SetConsoleBackGroudTextureState(bool state){m_BackGroundTextureState=state;}
    00163         inline void SetConsoleBackGroudBlendingState(bool state){m_Blending=state;}
    00164         inline void SetConsoleBackGroudBlending(float blending){m_fBlending=blending;}
    00165         inline void SetConsoleBackGroudColorRed(float value){m_fBackGroundRed=value;}
    00166         inline void SetConsoleBackGroudColorGreen(float value){m_fBackGroundGreen=value;}
    00167         inline void SetConsoleBackGroudColorBlue(float value){m_fBackGroundBlue=value;}
    00168         inline void SetConsoleBackGroudColor(float R,float G,float B ){m_fBackGroundBlue=B;m_fBackGroundGreen=G;m_fBackGroundRed=R;}
    00169
    00170         void LoadStringActionFile(const char *FileName);
    00171
    00172
    00173         ExCAction InputCommand(ExCCommand Command);
    00174         void ListConsoleCommand(void);
    00175
    00176         void LineUp(void);
    00177         void LineDown(void);
    00178
    00179
    00180         ExCAction InputAction(ExCAction Action);
    00181 };
    00182 #endif //__EXMANAGERCONSOLE_H__