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 
28 namespace Titanic {
29 
30 class CRoomFlags {
31 private:
32  uint _data;
33 private:
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; }
64 public:
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);
80 public:
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 
103  bool isSuccUBusRoomFlags() const;
104 
108  CString getRoomDesc() const;
109 
113  uint getElevatorBits() const;
114 
118  void setElevatorNum(uint val) { setElevatorBits(val - 1); }
119 
123  uint getElevatorNum() const { return getElevatorBits() + 1; }
124 
128  uint getPassengerClassBits() const;
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 
180  CString getElevatorDesc() const;
181 
185  CString getFloorDesc() const;
186 
190  CString getRoomNumDesc() const;
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 */
CString getSuccUBusRoomName() const
static bool compareClassElevator(uint flags1, uint flags2)
uint getPassengerClassBits() const
bool isFirstClassSuite() const
Definition: room_flags.h:227
CString getPassengerClassDesc() const
uint getFloorBits() const
Definition: room_flags.h:30
uint getRoomNum() const
Definition: room_flags.h:175
static PassengerClass whatPassengerClass(int floorNum)
PassengerClass getPassengerClassNum() const
Definition: room_flags.h:138
void setRandomLocation(PassengerClass classNum, bool flag)
CString getFloorDesc() const
uint getRoomBits() const
uint getFloorNum() const
void setRoomBits(uint roomBits)
CString getRoomNumDesc() const
bool isSuccUBusRoomFlags() const
Definition: arm.h:30
Definition: string.h:40
CString getElevatorDesc() const
CString getRoomDesc() const
void setElevatorNum(uint val)
Definition: room_flags.h:118
static uint getSpecialRoomFlags(const CString &roomName)
void changeClass(PassengerClass newClassNum)
void setFloorNum(uint floorNum)
bool isSuccUBusDest() const
Definition: room_flags.h:222
void setPassengerClassBits(uint val)
PassengerClass getSuccUBusClass(const CString &roomName) const
uint getElevatorNum() const
Definition: room_flags.h:123
static bool compareLocation(uint flags1, uint flags2)
uint getElevatorBits() const
static bool isTitania(uint flags1, uint flags2)