ScummVM API documentation
room_flags.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_ROOM_FLAGS_H
23#define TITANIC_ROOM_FLAGS_H
24
25#include "titanic/support/string.h"
26#include "titanic/game_location.h"
27
28namespace Titanic {
29
31private:
32 uint _data;
33private:
34 int getConditionally() const;
35
40 bool isTransportRoom() const;
41
42 int getRoomCategory() const;
43
44 int getRoomArea() const;
45
49 void setElevatorBits(uint val);
50
54 void setFloorBits(uint val);
55
59 uint decodeFloorBits(uint bits) const;
60
61 static bool is2To19(uint v) { return v >= 2 && v <= 19; }
62 static bool is20To27(uint v) { return v >= 20 && v <= 27; }
63 static bool is28To38(uint v) { return v >= 28 && v <= 38; }
64public:
69 static bool compareLocation(uint flags1, uint flags2);
70
74 static bool compareClassElevator(uint flags1, uint flags2);
75
79 static bool isTitania(uint flags1, uint flags2);
80public:
81 CRoomFlags() : _data(0) {}
82 CRoomFlags(uint data) : _data(data) {}
83 operator uint() { return _data; }
84
88 void set(uint data) { _data = data; }
89
93 uint get() const { return _data; }
94
98 static uint getSpecialRoomFlags(const CString &roomName);
99
104
109
113 uint getElevatorBits() const;
114
118 void setElevatorNum(uint val) { setElevatorBits(val - 1); }
119
123 uint getElevatorNum() const { return getElevatorBits() + 1; }
124
129
133 void setPassengerClassBits(uint val);
134
138 PassengerClass getPassengerClassNum() const {
139 return (PassengerClass)getPassengerClassBits();
140 }
141
146
150 uint getFloorBits() const;
151
155 void setFloorNum(uint floorNum);
156
160 uint getFloorNum() const;
161
165 void setRoomBits(uint roomBits);
166
170 uint getRoomBits() const;
171
175 uint getRoomNum() const { return getRoomBits(); }
176
181
186
191
192 bool getBit0() const;
193
197 void changeClass(PassengerClass newClassNum);
198
202 void setRandomLocation(PassengerClass classNum, bool flag);
203
207 PassengerClass getSuccUBusClass(const CString &roomName) const;
208
213
217 static PassengerClass whatPassengerClass(int floorNum);
218
222 bool isSuccUBusDest() const { return getConditionally() != 5; }
223
227 bool isFirstClassSuite() const {
228 return _data == 0x59706;
229 }
230};
231
232} // End of namespace Titanic
233
234#endif /* TITANIC_ROOM_FLAGS_H */
Definition: room_flags.h:30
static bool compareLocation(uint flags1, uint flags2)
PassengerClass getSuccUBusClass(const CString &roomName) const
CString getFloorDesc() const
uint getElevatorNum() const
Definition: room_flags.h:123
void setElevatorNum(uint val)
Definition: room_flags.h:118
CString getPassengerClassDesc() const
uint getFloorNum() const
uint getFloorBits() const
static PassengerClass whatPassengerClass(int floorNum)
void setPassengerClassBits(uint val)
CString getRoomDesc() const
PassengerClass getPassengerClassNum() const
Definition: room_flags.h:138
void setRandomLocation(PassengerClass classNum, bool flag)
uint getElevatorBits() const
static bool compareClassElevator(uint flags1, uint flags2)
bool isSuccUBusDest() const
Definition: room_flags.h:222
uint get() const
Definition: room_flags.h:93
uint getRoomBits() const
bool isFirstClassSuite() const
Definition: room_flags.h:227
void set(uint data)
Definition: room_flags.h:88
uint getPassengerClassBits() const
void setRoomBits(uint roomBits)
static bool isTitania(uint flags1, uint flags2)
CString getElevatorDesc() const
static uint getSpecialRoomFlags(const CString &roomName)
void changeClass(PassengerClass newClassNum)
uint getRoomNum() const
Definition: room_flags.h:175
CString getSuccUBusRoomName() const
CString getRoomNumDesc() const
void setFloorNum(uint floorNum)
bool isSuccUBusRoomFlags() const
Definition: string.h:40