ScummVM API documentation
location.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_LOCATIONS_LOCATION_H
23 #define MM1_VIEWS_ENH_LOCATIONS_LOCATION_H
24 
25 #include "mm/mm1/views_enh/party_view.h"
26 #include "mm/shared/xeen/sprites.h"
27 
28 namespace MM {
29 namespace MM1 {
30 namespace ViewsEnh {
31 namespace Locations {
32 
33 class Location : public PartyView {
34 protected:
36  int _locationId = -1;
37 
38 protected:
42  void timeout() override {
43  leave();
44  }
45 
49  bool subtractGold(uint amount);
50 
54  void displayMessage(const Common::String &msg);
55 
59  void notEnoughGold();
60 
64  void backpackFull();
65 
66 public:
67  Location(const Common::String &name, int locationId);
68 
72  bool msgGame(const GameMessage &msg) override;
73 
77  virtual void messageShown() {
78  leave();
79  }
80 
84  void leave();
85 
86  bool msgUnfocus(const UnfocusMessage &msg) override;
87 
91  void draw() override;
92 
96  bool tick() override;
97 };
98 
99 } // namespace Locations
100 } // namespace ViewsEnh
101 } // namespace MM1
102 } // namespace MM
103 
104 #endif
Definition: str.h:59
Definition: sprites.h:52
virtual void messageShown()
Definition: location.h:77
Definition: party_view.h:32
void timeout() override
Definition: location.h:42
Definition: detection.h:27
Definition: messages.h:48
Definition: messages.h:87
bool msgGame(const GameMessage &msg) override
void displayMessage(const Common::String &msg)