xref: /haiku/src/apps/pairs/PairsView.h (revision b55a57da7173b9af0432bd3e148d03f06161d036)
1 /*
2  * Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef PAIRS_VIEW_H
6 #define PAIRS_VIEW_H
7 
8 
9 #include <View.h>
10 
11 
12 class TopButton;
13 
14 class PairsView : public BView {
15 public:
16 								PairsView(BRect frame, const char* name,
17 									uint32 resizingMode);
18 
19 	virtual						~PairsView();
20 	virtual	void				AttachedToWindow();
21 	virtual	void				Draw(BRect updateRect);
22 	virtual	void				CreateGameBoard();
23 
24 			TopButton*			fDeckCard[16];
25 			int					GetIconFromPos(int pos);
26 
27 private:
28 			void				_SetPairsBoard();
29 			void				_ReadRandomIcons();
30 			void				_GenerateCardPos();
31 			bool				_HasBitmap(BList& bitmaps, BBitmap* bitmap);
32 
33 			BMessage*			fButtonMessage;
34 			BBitmap*			fCard[8];
35 			int					fRandPos[16];
36 			int					fPosX[16];
37 			int					fPosY[16];
38 };
39 
40 
41 #endif	// PAIRS_VIEW_H
42