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

PlayerSelect.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           PlayerSelect.h  -  description
00003                              -------------------
00004     begin                : 2003-09-05
00005     copyright            : (C) 2003 by upi
00006     email                : upi@apocalypse.rulez.org
00007  ***************************************************************************/
00008 
00009 
00010 #ifndef PLAYERSELECT_H
00011 #define PLAYERSELECT_H
00012 
00013 #define COLORSPERPLAYER     64
00014 #define COLOROFFSETPLAYER1  112
00015 #define COLOROFFSETPLAYER2  (COLOROFFSETPLAYER1+64)
00016 
00017 
00023 #include "FighterEnum.h"
00024 #include "common.h"
00025 
00026 #include <string>
00027 #include <vector>
00028 
00029 class CRlePack;
00030 struct SDL_Surface;
00031 class CTextArea;
00032 class CReadline;
00033 
00034 
00035 
00047 struct SPlayerInfo
00048 {
00049     FighterEnum     m_enFighter;
00050     TintEnum        m_enTint;
00051     CRlePack*       m_poPack;
00052     std::string     m_sFighterName;
00053 
00054     std::vector<FighterEnum> m_aenTeam;
00055 };
00056 
00057 
00058 
00072 class CPlayerSelect
00073 {
00074 public:
00075     CPlayerSelect();
00076     
00077     const SPlayerInfo& GetPlayerInfo( int a_iPlayer );
00078     SPlayerInfo& EditPlayerInfo( int a_iPlayer );
00079     const char* GetFighterName( int a_iPlayer );
00080     int GetFighterNameWidth( int a_iPlayer );
00081     
00082     void DoPlayerSelect();
00083     void SetPlayer( int a_iPlayer, FighterEnum a_enFighter );
00084     void SetTint( int a_iPlayer, TintEnum a_enFighter );
00085     bool IsFighterAvailable( FighterEnum a_enFighter );
00086     bool IsLocalFighterAvailable( FighterEnum a_enFighter );
00087     bool IsFighterInTeam( FighterEnum a_enFighter );
00088 
00089 
00090 protected:
00091 
00092     static CRlePack* LoadFighter( FighterEnum m_enFighter );
00093 
00094 protected:
00095     SPlayerInfo m_aoPlayers[MAXPLAYERS];
00096     int         m_aiFighterNameWidth[MAXPLAYERS];
00097 };
00098 
00099 
00100 extern CPlayerSelect g_oPlayerSelect;
00101 
00102 #endif // PLAYERSELECT_H