OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

Backend.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           Backend.h  -  description
00003                              -------------------
00004     begin                : Sun Dec 8 2002
00005     copyright            : (C) 2002 by upi
00006     email                : upi@apocalypse.rulez.org
00007  ***************************************************************************/
00008 
00009 
00010 #ifndef BACKEND_H
00011 #define BACKEND_H
00012 
00013 #include <string>
00014 #include "FighterEnum.h"
00015 
00016 class CRlePack;
00017 
00018 
00019 #define MAXDOODADS 20
00020 #define MAXSOUNDS 20
00021 
00022 
00046 class CBackend
00047 {
00048 public:
00049 
00050     // Lifecycle
00051     
00052     CBackend();
00053     ~CBackend();
00054     bool Construct();
00055     
00056     // Miscellaneous
00057     
00058     const char* PerlEvalF( const char* a_pcFormat, ... );
00059     const char* GetPerlString( const char* a_pcScalarName );
00060     int GetPerlInt( const char* a_pcScalarName );
00061 
00062     // Fighter enumeration
00063     
00064     int GetNumberOfFighters();
00065     FighterEnum GetFighterID( int a_iIndex );
00066     int GetNumberOfAvailableFighters();
00067     
00068     // Game data
00069     
00070     void AdvancePerl();
00071     void ReadFromPerl();
00072     bool IsDead( int a_iPlayer );
00073     void PlaySounds();
00074     void WriteToString( std::string& a_rsOutString );
00075     void ReadFromString( const std::string& a_rsString );
00076     void ReadFromString( const char* a_pcBuffer );
00077     
00078     
00079 public:
00080     int             m_iGameTick;
00081     int             m_iGameOver;
00082     bool            m_bKO;
00083     int             m_iBgX, m_iBgY;
00084     int             m_iNumDoodads;
00085     int             m_iNumSounds;
00086     
00087     struct SPlayer
00088     {
00089         int m_iX, m_iY, m_iFrame, m_iHitPoints, m_iRealHitPoints;
00090     }               m_aoPlayers[MAXPLAYERS];
00091     
00092     struct SDoodad
00093     {
00094         int m_iX, m_iY, m_iType, m_iFrame;
00095         int m_iDir, m_iGfxOwner;
00096         std::string m_sText;
00097     }               m_aoDoodads[ MAXDOODADS ];
00098 
00099     std::string     m_asSounds[ MAXSOUNDS ];
00100 };
00101 
00102 extern CBackend g_oBackend;
00103 
00104 
00105 #endif