ScummVM API documentation
tattoo_darts.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SHERLOCK_TATTOO_DARTS_H
23 #define SHERLOCK_TATTOO_DARTS_H
24 
25 #include "common/scummsys.h"
26 #include "sherlock/image_file.h"
27 
28 namespace Sherlock {
29 
30 class SherlockEngine;
31 
32 namespace Tattoo {
33 
34 enum GameType { GAME_301, GAME_CRICKET, GAME_501 };
35 
36 class Darts {
37 private:
38  SherlockEngine *_vm;
39  GameType _gameType;
40  ImageFile *_hand1, *_hand2;
41  ImageFile *_dartGraphics;
42  ImageFile *_dartsLeft;
43  ImageFile *_dartMap;
44  ImageFile *_dartBoard;
45  Common::Rect _dartInfo;
46  int _cricketScore[2][7];
47  int _score1, _score2;
48  int _roundNum;
49  int _roundScore;
50  int _level;
51  int _compPlay;
52  Common::String _opponent;
53  int _spacing;
54  bool _oldDartButtons;
55  int _handX;
56  Common::Point _handSize;
57  bool _escapePressed;
58 
62  void initDarts();
63 
67  void loadDarts();
68 
72  void closeDarts();
73 
77  void showNames(int playerNum);
78 
82  void showStatus(int playerNum);
83 
87  void erasePowerBars();
88 
92  bool dartHit();
93 
102  int doPowerBar(const Common::Point &pt, byte color, int goToPower, int orientation);
103 
108  int drawHand(int goToPower, int computer);
109 
113  Common::Point convertFromScreenToScoreCoords(const Common::Point &pt) const;
114 
118  int dartScore(const Common::Point &pt);
119 
123  void drawDartThrow(const Common::Point &dartPos, int computer);
124 
129  int findNumberOnBoard(int aim, Common::Point &pt);
130 
135  void getComputerNumber(int playerNum, Common::Point &targetPos);
136 
142  int throwDart(int dartNum, int computer);
143 
148  void doCricketScoreHits(int player, int scoreIndex, int numHits);
149 
153  void updateCricketScore(int player, int dartVal, int multiplier);
154 
158  void drawDartsLeft(int dartNum, int computer);
159 public:
160  Darts(SherlockEngine *vm);
161 
165  void playDarts(GameType gameType);
166 };
167 
168 } // End of namespace Tattoo
169 
170 } // End of namespace Sherlock
171 
172 #endif
Definition: str.h:59
void playDarts(GameType gameType)
Definition: animation.h:29
Definition: rect.h:144
Definition: sherlock.h:76
Definition: rect.h:45
Definition: image_file.h:78
Definition: tattoo_darts.h:36