1 /***************************************************************************
2                           Chooser.h  -  description
3                              -------------------
4     begin                : Tue Jan 27 2004
5     copyright            : (C) 2004 by upi
6     email                : upi@feel
7  ***************************************************************************/
8 
9 
10 #ifndef CHOOSER_H
11 #define CHOOSER_H
12 
13 
14 
15 #include "FighterEnum.h"
16 #include "common.h"
17 #include "SDL.h"
18 
19 
20 
21 class CChooser
22 {
23 public:
24 	CChooser();
25 	~CChooser();
26 
27 	void			Start( SDL_Surface* m_poScreen );
28 	void			Stop();
29 
30 	void			Resize( int x1, int y1, int x2, int y2 );
31 	void			Draw();
32 	void			MarkFighter( FighterEnum a_enFighter, Uint32 a_iColor );
33 	SDL_Surface*	GetPortrait( FighterEnum a_enFighter );
34 	void			DrawPortrait( FighterEnum a_enFighter, SDL_Surface* a_poScreen, const SDL_Rect& a_roRect );
35 
36 	FighterEnum		GetCurrentFighter( int a_iPlayer );
37 
38 	void			MoveRectangle( int a_iPlayer, int a_iDirection );
39 	void			SetRectangle( int a_iPlayer, FighterEnum a_enFighter );
40 	void			SetRectangleVisible( int a_iPlayer, bool a_bVisible );
41 	bool			IsRectangleVisible( int a_iPlayer );
42 	void			DrawRectangles( int a_iStartingWith );
43 	SDL_Rect		GetFighterRect( FighterEnum a_enFighter );
44 
45 protected:
46 	void			Init();
47 	int				FighterToPosition( FighterEnum a_enFighter );
48 	FighterEnum		PositionToFighter( int a_iPosition );
49 	SDL_Rect		GetRect( int a_iPosition );
50 
51 	void			ClearRectangle( int a_iPlayer );
52 	void			DrawRectangle( int a_iPlayer );
53 	void			DrawRectangle( int a_iPosition, Uint32 a_iColor );
54 
55 protected:
56 	SDL_Surface*	m_poScreen;
57 	FighterEnum		m_aenFighters[100];
58 	SDL_Surface*	m_apoPortraits[100];
59 	bool			m_abRectangleVisible[MAXPLAYERS];
60 	int				m_aiPlayerPosition[MAXPLAYERS];
61 	Uint32			m_aiColors[MAXPLAYERS];
62 
63 	int				x1, y1, x2, y2;
64 
65 	int				m_iNumberOfFighters;
66 	int				m_iRows;
67 	int				m_iCols;
68 
69 };
70 
71 extern CChooser g_oChooser;
72 
73 #endif // CHOOSER_H
74