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

PlayerSelectView.h

Go to the documentation of this file.
00001 #ifndef PLAYERSELECTVIEW_H
00002 #define PLAYERSELECTVIEW_H
00003 
00004 #include "FighterEnum.h"
00005 #include "State.h"
00006 #include <list>
00007 
00008 struct SDL_Surface;
00009 class CTextArea;
00010 class CReadline;
00011 class CPlayerSelectView;
00012 class CTeamDisplay;
00013 
00014 
00020 class IViewElement
00021 {
00022 public:
00023     IViewElement( CPlayerSelectView* a_poView, int a_iPriority );
00024     virtual ~IViewElement();
00025 
00026     int             GetPriority() const;
00027     virtual void    Advance( int a_iNumFrames ) = 0;
00028     virtual void    Draw() = 0;
00029 
00030 protected:
00031     CPlayerSelectView*      m_poView;
00032     int                     m_iPriority;
00033 };
00034 
00035 
00036 
00042 class CPlayerSelectView
00043 {
00044 public:
00045     CPlayerSelectView( bool a_bNetworkGame, bool a_bTeamMode );
00046     ~CPlayerSelectView();
00047     
00048     void            Advance( int a_iNumFrames );
00049     void            Draw();
00050     CTextArea*      GetTextArea();
00051     CReadline*      GetReadline();
00052 
00053     void            AddViewElement( IViewElement* a_poElement, int a_iPriority );
00054     void            RemoveViewElement( IViewElement* a_poElement );
00055     void            AddFighterToTeam( int a_iPlayer, FighterEnum a_enFighter );
00056     bool            IsOver();
00057 
00058     CTeamDisplay*   GetTeamDisplay( int a_iPlayer );
00059 
00060 protected:
00061     bool            m_bTeamMode;
00062     bool            m_bTeamMultiselect;
00063     bool            m_bNetworkGame;
00064     SDL_Surface*    m_poBackground;
00065     CTextArea*      m_poTextArea;
00066     CReadline*      m_poReadline;
00067     bool            m_bOver;
00068 
00069     int             m_iChooserTop;
00070     int             m_iChooserLeft;
00071     int             m_iChooserHeight;
00072     int             m_iChooserWidth;
00073     int             m_iFighterYOffset;
00074     int             m_iFighterNameYOffset;
00075     
00076     int             m_iTime;
00077     typedef std::list<IViewElement*> TViewElements;
00078     TViewElements   m_apoElements;
00079     CTeamDisplay*   m_apoTeamDisplays[MAXPLAYERS];
00080 };
00081 
00082 #endif // PLAYERSELECTVIEW_H