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 |
|
---|
18 | class TMarker;
|
---|
19 | class TVirtualPad;
|
---|
20 |
|
---|
21 | class MGeomCam;
|
---|
22 | class MHexagon;
|
---|
23 |
|
---|
24 | class MagicDomino : public TObject
|
---|
25 | {
|
---|
26 | private:
|
---|
27 |
|
---|
28 | #pragma GCC diagnostic push
|
---|
29 | #pragma GCC diagnostic ignored "-Wshadow"
|
---|
30 | enum
|
---|
31 | {
|
---|
32 | kBackground = 50,
|
---|
33 | kIsTile = BIT(16),
|
---|
34 | kRight = BIT(17),
|
---|
35 | kLeft = BIT(18),
|
---|
36 | kTop = BIT(19),
|
---|
37 | kBottom = BIT(20),
|
---|
38 | kUserBits = 0x7fc000, // 14-23 are allowed
|
---|
39 |
|
---|
40 | kBottomLeft = kBottom|kLeft,
|
---|
41 | kBottomRight = kBottom|kRight,
|
---|
42 | kTopLeft = kTop|kLeft,
|
---|
43 | kTopRight = kTop|kRight
|
---|
44 | };
|
---|
45 | #pragma GCC diagnostic pop
|
---|
46 |
|
---|
47 | MGeomCam *fGeomCam; // pointer to camera geometry
|
---|
48 |
|
---|
49 | UShort_t fNumPixels; // number of pixels in the present geometry
|
---|
50 | Short_t fNumPixel; // number of actual pixel
|
---|
51 | Int_t fNumTile; // number of setteled tiles
|
---|
52 | Float_t fRange; // the range in millimeters of the present geometry
|
---|
53 |
|
---|
54 | Int_t fPoints; // points you got
|
---|
55 |
|
---|
56 | Int_t fDir; // direction you move the tile
|
---|
57 |
|
---|
58 | Int_t fOldColors[7]; // colors of hexagons which are under the tile
|
---|
59 | Int_t fNewColors[6]; // colors of the tile itself
|
---|
60 | Byte_t fPosition; // rotation position of colors in tile
|
---|
61 | Byte_t fSkipped; // number of skipped tiles
|
---|
62 |
|
---|
63 | TText fDomino; // TText showing status informations
|
---|
64 | TText *fText[6]; // ttext showing the six numbers in the tile
|
---|
65 | TText *fDone; // game over text
|
---|
66 |
|
---|
67 | TArrayI fColors;
|
---|
68 |
|
---|
69 | Bool_t CheckTile();
|
---|
70 | void NewTile();
|
---|
71 | void NewColors();
|
---|
72 | void HideTile();
|
---|
73 | void ShowTile();
|
---|
74 | void RotateTile(Int_t add);
|
---|
75 | void Update();
|
---|
76 | void Free();
|
---|
77 | void Done();
|
---|
78 | void RemoveNumbers();
|
---|
79 | void SetNewCamera(MGeomCam *);
|
---|
80 | void ChangePixel(Int_t add);
|
---|
81 | void Step(Int_t dir);
|
---|
82 | Short_t AnalysePixel(Int_t dir);
|
---|
83 | void GetSortedNeighbors(Int_t indices[6]);
|
---|
84 | void Init();
|
---|
85 |
|
---|
86 | void Draw(Option_t *option="");
|
---|
87 | void Paint(Option_t *option="");
|
---|
88 | void ExecuteEvent(Int_t event, Int_t px, Int_t py);
|
---|
89 | Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
|
---|
90 |
|
---|
91 | public:
|
---|
92 | MagicDomino();
|
---|
93 | MagicDomino(const MGeomCam &geom);
|
---|
94 | ~MagicDomino();
|
---|
95 |
|
---|
96 | void Reset(); //*MENU*
|
---|
97 | void ChangeCamera(); //*MENU*
|
---|
98 |
|
---|
99 | ClassDef(MagicDomino, 0) // Magic Camera Games: Some kind of Domino
|
---|
100 | };
|
---|
101 |
|
---|
102 | #endif
|
---|