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

CPlayerSelect Class Reference
[Fighter selection]

This class implements services that allows players to select their fighters. More...

#include <PlayerSelect.h>

List of all members.

Public Member Functions

 CPlayerSelect ()
const SPlayerInfoGetPlayerInfo (int a_iPlayer)
 Returns the info of a given player.
SPlayerInfoEditPlayerInfo (int a_iPlayer)
const char * GetFighterName (int a_iPlayer)
int GetFighterNameWidth (int a_iPlayer)
void DoPlayerSelect ()
void SetPlayer (int a_iPlayer, FighterEnum a_enFighter)
 SetPlayer loads the given fighter for the given player.
void SetTint (int a_iPlayer, TintEnum a_enFighter)
bool IsFighterAvailable (FighterEnum a_enFighter)
 Returns true if the given fighter can be used.
bool IsLocalFighterAvailable (FighterEnum a_enFighter)
bool IsFighterInTeam (FighterEnum a_enFighter)

Static Protected Member Functions

static CRlePackLoadFighter (FighterEnum m_enFighter)
 LoadFighter simply looks up the filename associated with the given fighter, loads it, and returns the CRlePack.

Protected Attributes

SPlayerInfo m_aoPlayers [MAXPLAYERS]
int m_aiFighterNameWidth [MAXPLAYERS]


Detailed Description

This class implements services that allows players to select their fighters.

It also stores info about which fighter is available, and allows other parts of the program to programmatically assign a fighter to a player, and set fighter tints (this is used by e.g. the "frozen" effect.)

This is the model part model-view-controller architecture of the player selection.


Constructor & Destructor Documentation

CPlayerSelect::CPlayerSelect  ) 
 


Member Function Documentation

void CPlayerSelect::DoPlayerSelect  ) 
 

SPlayerInfo & CPlayerSelect::EditPlayerInfo int  a_iPlayer  ) 
 

const char * CPlayerSelect::GetFighterName int  a_iPlayer  ) 
 

int CPlayerSelect::GetFighterNameWidth int  a_iPlayer  ) 
 

const SPlayerInfo & CPlayerSelect::GetPlayerInfo int  a_iPlayer  ) 
 

Returns the info of a given player.

The most important piece in the info is the player's CRlePack which is used for drawing the player in the Game, the GameOver and the FighterInfo screens.

bool CPlayerSelect::IsFighterAvailable FighterEnum  a_enFighter  ) 
 

Returns true if the given fighter can be used.

Some fighters are just not in the data files yet, or not installed.

bool CPlayerSelect::IsFighterInTeam FighterEnum  a_enFighter  ) 
 

bool CPlayerSelect::IsLocalFighterAvailable FighterEnum  a_enFighter  ) 
 

CRlePack * CPlayerSelect::LoadFighter FighterEnum  m_enFighter  )  [static, protected]
 

LoadFighter simply looks up the filename associated with the given fighter, loads it, and returns the CRlePack.

Returns:
The freshly loaded CRlePack, or NULL if it could not be loaded.

void CPlayerSelect::SetPlayer int  a_iPlayer,
FighterEnum  a_enFighter
 

SetPlayer loads the given fighter for the given player.

The CRlePack is loaded first. If that succeeds, then the perl backend is set too. The tint and palette of both players are set.

void CPlayerSelect::SetTint int  a_iPlayer,
TintEnum  a_enFighter
 


Member Data Documentation

int CPlayerSelect::m_aiFighterNameWidth[MAXPLAYERS] [protected]
 

SPlayerInfo CPlayerSelect::m_aoPlayers[MAXPLAYERS] [protected]
 


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