ScummVM API documentation
search.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 MM1_VIEWS_ENH_SEARCH_H
23 #define MM1_VIEWS_ENH_SEARCH_H
24 
25 #include "mm/mm1/views_enh/select_number.h"
26 
27 namespace MM {
28 namespace MM1 {
29 namespace ViewsEnh {
30 
31 class Search : public SelectNumber {
32 private:
33  enum Mode {
34  INITIAL, OPTIONS, RESPONSE, GET_TREASURE, GET_ITEMS,
35  GET_ITEMS_DONE
36  };
37  enum OptionMode {
38  OMODE_OPEN, OMODE_REMOVE_TRAP, OMODE_DETECT
39  };
40  Mode _mode = INITIAL;
41  OptionMode _optionMode = OMODE_OPEN;
42  byte _val1 = 0;
43  int _lineNum = 0;
45 
46  void setMode(Mode mode);
47 
51  void openContainer();
52  void openContainer2();
53 
57  void findRemoveTrap();
58  void findRemoveTrap2();
59 
63  void detectMagicTrap();
64  void detectMagicTrap2();
65 
69  bool whoWillTry();
70 
74  void getTreasure();
75 
79  void drawTreasure();
80 
84  void drawItem();
85 
86 public:
87  Search();
88  virtual ~Search() {}
89 
90  bool msgGame(const GameMessage &msg) override;
91  bool msgFocus(const FocusMessage &msg) override;
92  void draw() override;
93  bool msgKeypress(const KeypressMessage &msg) override;
94  bool msgAction(const ActionMessage &msg) override;
95  void timeout() override;
96 
100  void whoWillTry(int charNum);
101 };
102 
103 } // namespace ViewsEnh
104 } // namespace MM1
105 } // namespace MM
106 
107 #endif
Definition: sprites.h:52
bool msgFocus(const FocusMessage &msg) override
Definition: messages.h:56
Definition: messages.h:49
Definition: detection.h:27
Definition: search.h:31
Definition: messages.h:87
void timeout() override
Definition: select_number.h:50
Definition: messages.h:41