source: trunk/Mars/mtools/MagicDomino.h@ 17284

Last change on this file since 17284 was 9369, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 2.6 KB
Line 
1#ifndef MARS_MagicDomino
2#define MARS_MagicDomino
3
4#ifndef MARS_MAGIC
5#include "MAGIC.h"
6#endif
7
8#ifndef ROOT_TText
9#include <TText.h>
10#endif
11#ifndef ROOT_TClonesArray
12#include <TClonesArray.h>
13#endif
14#ifndef ROOT_TArrayI
15#include <TArrayI.h>
16#endif
17
18class TMarker;
19class TVirtualPad;
20
21class MGeomCam;
22class MHexagon;
23
24class MagicDomino : public TObject
25{
26private:
27 enum
28 {
29 kBackground = 50,
30 kIsTile = BIT(16),
31 kRight = BIT(17),
32 kLeft = BIT(18),
33 kTop = BIT(19),
34 kBottom = BIT(20),
35 kUserBits = 0x7fc000, // 14-23 are allowed
36
37 kBottomLeft = kBottom|kLeft,
38 kBottomRight = kBottom|kRight,
39 kTopLeft = kTop|kLeft,
40 kTopRight = kTop|kRight
41
42 };
43
44 MGeomCam *fGeomCam; // pointer to camera geometry
45
46 UShort_t fNumPixels; // number of pixels in the present geometry
47 Short_t fNumPixel; // number of actual pixel
48 Int_t fNumTile; // number of setteled tiles
49 Float_t fRange; // the range in millimeters of the present geometry
50
51 Int_t fPoints; // points you got
52
53 Int_t fDir; // direction you move the tile
54
55 Int_t fOldColors[7]; // colors of hexagons which are under the tile
56 Int_t fNewColors[6]; // colors of the tile itself
57 Byte_t fPosition; // rotation position of colors in tile
58 Byte_t fSkipped; // number of skipped tiles
59
60 TText fDomino; // TText showing status informations
61 TText *fText[6]; // ttext showing the six numbers in the tile
62 TText *fDone; // game over text
63
64 TArrayI fColors;
65
66 Bool_t CheckTile();
67 void NewTile();
68 void NewColors();
69 void HideTile();
70 void ShowTile();
71 void RotateTile(Int_t add);
72 void Update();
73 void Free();
74 void Done();
75 void RemoveNumbers();
76 void SetNewCamera(MGeomCam *);
77 void ChangePixel(Int_t add);
78 void Step(Int_t dir);
79 Short_t AnalysePixel(Int_t dir);
80 void GetSortedNeighbors(Int_t indices[6]);
81 void Init();
82
83 void Draw(Option_t *option="");
84 void Paint(Option_t *option="");
85 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
86 Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
87
88public:
89 MagicDomino();
90 MagicDomino(const MGeomCam &geom);
91 ~MagicDomino();
92
93 void Reset(); //*MENU*
94 void ChangeCamera(); //*MENU*
95
96 ClassDef(MagicDomino, 0) // Magic Camera Games: Some kind of Domino
97};
98
99#endif
Note: See TracBrowser for help on using the repository browser.