source: trunk/MagicSoft/Mars/mtools/MagicReversi.h@ 9492

Last change on this file since 9492 was 9369, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 2.0 KB
Line 
1#ifndef MARS_MagicReversi
2#define MARS_MagicReversi
3
4#ifndef MARS_MAGIC
5#include "MAGIC.h"
6#endif
7#ifndef ROOT_TClonesArray
8#include <TClonesArray.h>
9#endif
10#ifndef ROOT_TArrayI
11#include <TArrayI.h>
12#endif
13
14class TText;
15class TMarker;
16class TVirtualPad;
17
18class MGeomCam;
19class MHexagon;
20
21class MagicReversi : public TObject
22{
23private:
24 MGeomCam *fGeomCam; // pointer to camera geometry
25
26 UInt_t fNumPixels; // number of pixels in the present geometry
27 Float_t fRange; // the range in millimeters of the present geometry
28
29 TClonesArray *fText; // array of all texts
30 TClonesArray *fFlags; // array of all texts
31
32 TArrayI fColors;
33
34 TText *fDone; // TText showing the 'Game over'
35 TText *fUsrTxt[6]; // TText showing the numbers of pixels and bombs
36
37 Int_t fNumUsers;
38 Int_t fNumUser;
39 Int_t fUsrPts[6];
40
41 enum
42 {
43 kEmpty = 50,
44 kIsVisible = BIT(16),
45 kHasBomb = BIT(17),
46 kHasFlag = BIT(18),
47 kUserBits = 0x7fc000 // 14-23 are allowed
48 };
49
50 TText *GetText(Int_t i) { return (TText*)fText->At(i); }
51 TMarker *GetFlag(Int_t i) { return (TMarker*)fFlags->At(i); }
52
53 void Done();
54 void Update();
55 void SetNewCamera(MGeomCam *);
56 void Free();
57 void Init();
58
59 Bool_t Flip(Int_t idx, Bool_t flip);
60 Bool_t CheckMoves();
61
62 void Paint(Option_t *option="");
63 void Draw(Option_t *option="");
64 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
65 Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
66
67public:
68 MagicReversi();
69 MagicReversi(const MGeomCam &geom);
70 ~MagicReversi();
71
72 void Reset(); //*MENU*
73 void ChangeCamera(); //*MENU*
74 void TwoPlayer(); //*MENU*
75 void ThreePlayer(); //*MENU*
76 void FourPlayer(); //*MENU*
77 void FivePlayer(); //*MENU*
78 void SixPlayer(); //*MENU*
79
80 ClassDef(MagicReversi, 0) // Magic Camera Games: Reversi
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.