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

CBackend Class Reference
[Game logic (frontend + backend connection)]

The CBackend class provides access to the perl game engine. More...

#include <Backend.h>

List of all members.

Public Member Functions

 CBackend ()
 ~CBackend ()
bool Construct ()
const char * PerlEvalF (const char *a_pcFormat,...)
const char * GetPerlString (const char *a_pcScalarName)
int GetPerlInt (const char *a_pcScalarName)
int GetNumberOfFighters ()
 Returns the total number of registered fighters in the backend.
FighterEnum GetFighterID (int a_iIndex)
 Returns the ID of a fighter.
int GetNumberOfAvailableFighters ()
 Returns the number of fighters that are locally availaible for play.
void AdvancePerl ()
 Makes the perl interpreted advance from the current scene to the next one.
void ReadFromPerl ()
bool IsDead (int a_iPlayer)
void PlaySounds ()
void WriteToString (std::string &a_rsOutString)
void ReadFromString (const std::string &a_rsString)
void ReadFromString (const char *a_pcBuffer)

Public Attributes

int m_iGameTick
int m_iGameOver
bool m_bKO
int m_iBgX
int m_iBgY
int m_iNumDoodads
int m_iNumSounds
CBackend::SPlayer m_aoPlayers [MAXPLAYERS]
CBackend::SDoodad MAXDOODADS
std::string m_asSounds [MAXSOUNDS]

Classes

struct  SDoodad
struct  SPlayer


Detailed Description

The CBackend class provides access to the perl game engine.

The backend maintains just about all game-relevant data, such as fighters, player information, doodads, current game state, and so forth. CBackend provides access for the frontend to the backend's variables and functions. Some of this is done via custom methods (such as GetNumberOfFighters()), but certain functions are only available via the "generic" perl interface, PerlEvalF().

It is the CBackend's job to provide variables which describe the current scene to the frontend. The backend can

The string conversion routines are used for saving replays and instant playback.


Constructor & Destructor Documentation

CBackend::CBackend  ) 
 

CBackend::~CBackend  ) 
 


Member Function Documentation

void CBackend::AdvancePerl  ) 
 

Makes the perl interpreted advance from the current scene to the next one.

This should be called a constant number of time per second to make the game running seamlessly. Most speedup or slowdown effects are accomplished by changing the frequency at which this method is called.

bool CBackend::Construct  ) 
 

FighterEnum CBackend::GetFighterID int  a_iIndex  ) 
 

Returns the ID of a fighter.

The index parameter should start from zero, and be less than the value returned by GetNumberOfFighters().

See also:
GetNumberOfFighters

int CBackend::GetNumberOfAvailableFighters  ) 
 

Returns the number of fighters that are locally availaible for play.

This number is smaller or equal to the value returned by GetNumberOfFighters().

Note that the method GetFighterID() returns ID's of non-available fighters as well, so it can only be used in conjunction with GetNumberOfFighters()

See also:
GetNumberOfFighters

int CBackend::GetNumberOfFighters  ) 
 

Returns the total number of registered fighters in the backend.

This may be more than the actual number of playable characters, as some or many characters may not be ready or installed.

See also:
GetFighterID

GetNumberOfAvailableFighters

int CBackend::GetPerlInt const char *  a_pcScalarName  ) 
 

const char * CBackend::GetPerlString const char *  a_pcScalarName  ) 
 

bool CBackend::IsDead int  a_iPlayer  ) 
 

const char * CBackend::PerlEvalF const char *  a_pcFormat,
  ...
 

void CBackend::PlaySounds  ) 
 

void CBackend::ReadFromPerl  ) 
 

void CBackend::ReadFromString const char *  a_pcBuffer  ) 
 

void CBackend::ReadFromString const std::string &  a_rsString  ) 
 

void CBackend::WriteToString std::string &  a_rsOutString  ) 
 


Member Data Documentation

struct CBackend::SPlayer CBackend::m_aoPlayers[MAXPLAYERS]
 

std::string CBackend::m_asSounds[MAXSOUNDS]
 

bool CBackend::m_bKO
 

int CBackend::m_iBgX
 

int CBackend::m_iBgY
 

int CBackend::m_iGameOver
 

int CBackend::m_iGameTick
 

int CBackend::m_iNumDoodads
 

int CBackend::m_iNumSounds
 

struct CBackend::SDoodad CBackend::MAXDOODADS
 


The documentation for this class was generated from the following files: