ScummVM API documentation
pet_rooms.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 TITANIC_PET_ROOMS_H
23 #define TITANIC_PET_ROOMS_H
24 
25 #include "titanic/pet_control/pet_section.h"
26 #include "titanic/gfx/text_control.h"
27 #include "titanic/pet_control/pet_rooms_glyphs.h"
28 #include "titanic/game_location.h"
29 
30 namespace Titanic {
31 
32 class CPetRooms : public CPetSection {
33 private:
34  CPetRoomsGlyphs _glyphs;
35  CPetRoomsGlyph _glyphItem;
36  CGameObject *_chevLeftOnDim;
37  CGameObject *_chevLeftOffDim;
38  CGameObject *_chevRightOnDim;
39  CGameObject *_chevRightOffDim;
40  CGameObject *_chevLeftOnLit;
41  CGameObject *_chevLeftOffLit;
42  CGameObject *_chevRightOnLit;
43  CGameObject *_chevRightOffLit;
44  CPetGfxElement _plinth;
45  CTextControl _text;
46  int _floorNum;
47  int _elevatorNum;
48  int _roomNum;
49  int _sublevel;
50  int _wellEntry;
51  bool _elevatorBroken;
52 private:
56  bool setupControl(CPetControl *petControl);
57 
61  Point getGlyphPos() const { return Point(509, 388); }
62 
66  CPetRoomsGlyph *addRoom(uint roomFlags, bool highlight);
67 
71  CPetRoomsGlyph *addGlyph(uint roomFlags, bool highlight);
72 public:
73  CPetRooms();
74 
78  bool setup(CPetControl *petControl) override;
79 
83  bool reset() override;
84 
88  void draw(CScreenManager *screenManager) override;
89 
94  bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override;
95  bool MouseDragStartMsg(CMouseDragStartMsg *msg) override;
96  bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) override;
97  bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) override;
98  bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) override;
99 
103  bool checkDragEnd(CGameObject *item) override;
104 
108  void displayMessage(const CString &msg) override;
109 
113  bool isValid(CPetControl *petControl) override;
114 
118  void load(SimpleFile *file, int param) override;
119 
123  void postLoad() override;
124 
128  void save(SimpleFile *file, int indent) override;
129 
133  void enter(PetArea oldArea) override;
134 
138  void enterRoom(CRoomItem *room) override;
139 
143  CTextControl *getText() override;
144 
148  CGameObject *getBackground(int index) const override;
149 
153  void resetHighlight();
154 
158  void reassignRoom(PassengerClass passClassNum);
159 
163  bool changeLocationClass(PassengerClass newClassNum);
164 
169  bool isAssignedRoom(uint roomFlags) const;
170 
174  uint getAssignedRoomFlags() const;
175 
179  int getAssignedRoomNum() const;
180 
184  int getAssignedFloorNum() const;
185 
189  int getAssignedElevatorNum() const;
190 
194  uint getRoomFlags() const;
195 
196  void setFloorNum(int floorNum) { _floorNum = floorNum; }
197  int getFloorNum() const { return _floorNum; }
198  void setElevatorNum(int elevNum) { _elevatorNum = elevNum; }
199  int getElevatorNum() const { return _elevatorNum; }
200  void setRoomNum(int roomNum) { _roomNum = roomNum; }
201  int getRoomNum() const { return _roomNum; }
202  void setSublevel(int level) { _sublevel = level; }
203  int getSublevel() const { return _sublevel; }
204 
208  void setWellEntry(int val) { _wellEntry = val; }
209 
213  int getWellEntry() const { return _wellEntry; }
214 
218  void setElevatorBroken(bool flag) { _elevatorBroken = flag; }
219 };
220 
221 } // End of namespace Titanic
222 
223 #endif /* TITANIC_PET_ROOMS_H */
Definition: mouse_messages.h:150
void enter(PetArea oldArea) override
bool isAssignedRoom(uint roomFlags) const
CTextControl * getText() override
Definition: text_control.h:35
int getAssignedElevatorNum() const
Definition: mouse_messages.h:117
bool isValid(CPetControl *petControl) override
Definition: pet_section.h:51
int getWellEntry() const
Definition: pet_rooms.h:213
void draw(CScreenManager *screenManager) override
void enterRoom(CRoomItem *room) override
CGameObject * getBackground(int index) const override
Definition: simple_file.h:49
bool reset() override
Definition: room_item.h:33
Definition: screen_manager.h:49
Definition: pet_gfx_element.h:29
Definition: pet_rooms_glyphs.h:36
Definition: game_object.h:79
Definition: messages.h:408
uint getAssignedRoomFlags() const
Definition: pet_rooms.h:32
void save(SimpleFile *file, int indent) override
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override
void displayMessage(const CString &msg) override
bool checkDragEnd(CGameObject *item) override
virtual void highlight(int id)
Definition: pet_section.h:229
Definition: rect.h:45
Definition: arm.h:30
Definition: string.h:40
Definition: pet_rooms_glyphs.h:147
Definition: mouse_messages.h:87
void setElevatorBroken(bool flag)
Definition: pet_rooms.h:218
uint getRoomFlags() const
Definition: mouse_messages.h:71
bool setup(CPetControl *petControl) override
int getAssignedFloorNum() const
int getAssignedRoomNum() const
void postLoad() override
bool changeLocationClass(PassengerClass newClassNum)
void reassignRoom(PassengerClass passClassNum)
Definition: pet_control.h:45
void setWellEntry(int val)
Definition: pet_rooms.h:208
void load(SimpleFile *file, int param) override