ScummVM API documentation
reactor.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  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_NEIGHBORHOOD_MARS_REACTOR_H
26 #define PEGASUS_NEIGHBORHOOD_MARS_REACTOR_H
27 
28 #include "pegasus/elements.h"
29 #include "pegasus/surface.h"
30 #include "pegasus/util.h"
31 
32 namespace Pegasus {
33 
34 class ReactorGuess : public DisplayElement {
35 public:
36  ReactorGuess(const DisplayElementID);
37  ~ReactorGuess() override {}
38 
39  void initReactorGuess();
40  void disposeReactorGuess();
41 
42  void setGuess(int32, int32, int32);
43 
44  void draw(const Common::Rect &) override;
45 
46 protected:
47  int32 _currentGuess[3];
48 
49  Surface _colors;
50 };
51 
53 public:
54  ReactorChoiceHighlight(const DisplayElementID);
55  ~ReactorChoiceHighlight() override {}
56 
57  void initReactorChoiceHighlight();
58  void disposeReactorChoiceHighlight();
59 
60  void resetHighlight() {
61  _choices.clearAllFlags();
62  triggerRedraw();
63  }
64 
65  bool choiceHighlighted(uint32 whichChoice) { return _choices.getFlag(whichChoice); }
66 
67  void draw(const Common::Rect &) override;
68 
69  void highlightChoice(uint32 whichChoice) {
70  _choices.setFlag(whichChoice);
71  triggerRedraw();
72  }
73 
74 protected:
75  Surface _colors;
76  FlagsArray<byte, 5> _choices;
77 };
78 
80 public:
81  ReactorHistory(const DisplayElementID);
82  ~ReactorHistory() override {}
83 
84  void initReactorHistory();
85  void disposeReactorHistory();
86 
87  void draw(const Common::Rect &) override;
88 
89  void addGuess(int32, int32, int32);
90  int32 getNumGuesses() { return _numGuesses; }
91  void clearHistory();
92  void setAnswer(int32, int32, int32);
93  void showAnswer();
94  bool isSolved();
95  int32 getCurrentNumCorrect();
96 
97 protected:
98  Surface _colors, _digits, _answerColors;
99  int32 _answer[3];
100  int32 _history[5][3];
101  int32 _numGuesses;
102  bool _showAnswer;
103 };
104 
105 } // End of namespace Pegasus
106 
107 #endif
Definition: reactor.h:79
Definition: rect.h:144
Definition: reactor.h:52
Definition: reactor.h:34
Definition: elements.h:43
Definition: surface.h:50
Definition: ai_action.h:33