ScummVM API documentation
pet_rooms_glyphs.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_GLYPHS_H
23#define TITANIC_PET_ROOMS_GLYPHS_H
24
25#include "titanic/pet_control/pet_glyphs.h"
26#include "titanic/game_location.h"
27
28namespace Titanic {
29
30class SimpleFile;
31
32enum RoomGlyphMode {
33 RGM_UNASSIGNED = 0, RGM_ASSIGNED_ROOM = 1, RGM_PREV_ASSIGNED_ROOM = 2
34};
35
36class CPetRoomsGlyph : public CPetGlyph {
37private:
38 uint _roomFlags;
39 uint _mailFlag;
40 RoomGlyphMode _mode;
41 CGameObject *_chevLeftOnDim;
42 CGameObject *_chevLeftOffDim;
43 CGameObject *_chevLeftOnLit;
44 CGameObject *_chevLeftOffLit;
45 CGameObject *_chevRightOnDim;
46 CGameObject *_chevRightOffDim;
47 CGameObject *_chevRightOnLit;
48 CGameObject *_chevRightOffLit;
49private:
54 int getSelection(const Point &topLeft, const Point &pt);
55
59 void drawObjects(uint flags, const Point &pt, CScreenManager *screenManager);
60public:
62 CPetRoomsGlyph(uint flags);
63
67 bool setup(CPetControl *petControl, CPetGlyphs *owner) override;
68
72 void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) override;
73
77 void draw2(CScreenManager *screenManager) override {}
78
82 void selectGlyph(const Point &topLeft, const Point &pt) override;
83
87 bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) override;
88
92 void getTooltip(CTextControl *text) override;
93
97 void saveGlyph(SimpleFile *file, int indent) override;
98
99 bool proc33(CPetGlyph *glyph) override;
100
104 virtual void loadFlags(SimpleFile *file, int val);
105
109 void setRoomFlags(uint flags) { _roomFlags = flags; }
110
114 uint getRoomFlags() const { return _roomFlags; }
115
119 void setFlag(uint val) { _mailFlag = val; }
120
124 void setMode(RoomGlyphMode mode) { _mode = mode; }
125
129 void changeClass(PassengerClass newClassNum);
130
134 bool isAssigned() const { return _mode != RGM_UNASSIGNED; }
135
139 bool isCurrentlyAssigned() const { return _mode == RGM_ASSIGNED_ROOM; }
140
144 bool isPreviouslyAssigned() const { return _mode == RGM_PREV_ASSIGNED_ROOM; }
145};
146
148private:
149public:
153 void saveGlyphs(SimpleFile *file, int indent);
154
159
164
168 bool hasFlags(uint flags) const { return findGlyphByFlags(flags) != nullptr; }
169};
170
171} // End of namespace Titanic
172
173#endif /* TITANIC_PET_ROOMS_GLYPHS_H */
Definition: game_object.h:79
Definition: mouse_messages.h:150
Definition: pet_control.h:45
Definition: pet_glyphs.h:53
bool isHighlighted() const
Definition: pet_glyphs.h:244
Definition: pet_rooms_glyphs.h:36
bool isPreviouslyAssigned() const
Definition: pet_rooms_glyphs.h:144
bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) override
void setMode(RoomGlyphMode mode)
Definition: pet_rooms_glyphs.h:124
bool isAssigned() const
Definition: pet_rooms_glyphs.h:134
bool setup(CPetControl *petControl, CPetGlyphs *owner) override
void saveGlyph(SimpleFile *file, int indent) override
virtual void loadFlags(SimpleFile *file, int val)
void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) override
bool isCurrentlyAssigned() const
Definition: pet_rooms_glyphs.h:139
void changeClass(PassengerClass newClassNum)
void draw2(CScreenManager *screenManager) override
Definition: pet_rooms_glyphs.h:77
uint getRoomFlags() const
Definition: pet_rooms_glyphs.h:114
void selectGlyph(const Point &topLeft, const Point &pt) override
void setRoomFlags(uint flags)
Definition: pet_rooms_glyphs.h:109
void setFlag(uint val)
Definition: pet_rooms_glyphs.h:119
void getTooltip(CTextControl *text) override
Definition: pet_rooms_glyphs.h:147
CPetRoomsGlyph * findAssignedRoom() const
bool hasFlags(uint flags) const
Definition: pet_rooms_glyphs.h:168
void saveGlyphs(SimpleFile *file, int indent)
CPetRoomsGlyph * findGlyphByFlags(uint flags) const
Definition: screen_manager.h:49
Definition: text_control.h:35
Definition: simple_file.h:49
Definition: rect.h:144