00001
00002
00003
00004
00005
00006
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
00051
00052 CBackend();
00053 ~CBackend();
00054 bool Construct();
00055
00056
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
00063
00064 int GetNumberOfFighters();
00065 FighterEnum GetFighterID( int a_iIndex );
00066 int GetNumberOfAvailableFighters();
00067
00068
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