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

Last change on this file since 20103 was 20095, checked in by tbretz, 4 years ago
Oh great master of the root universe, thanks for you namepace polution.
File size: 2.7 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#pragma GCC diagnostic push
38#pragma GCC diagnostic ignored "-Wshadow"
39 kBottomLeft = kBottom|kLeft,
40 kBottomRight = kBottom|kRight,
41 kTopLeft = kTop|kLeft,
42 kTopRight = kTop|kRight
43#pragma GCC diagnostic pop
44
45 };
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
91public:
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
Note: See TracBrowser for help on using the repository browser.