ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
objects.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 DARKSEED_OBJECTS_H
23 #define DARKSEED_OBJECTS_H
24 
25 #include "common/array.h"
26 #include "common/error.h"
27 #include "common/rect.h"
28 #include "common/serializer.h"
29 
30 namespace Darkseed {
31 
32 enum ObjType {
33  OBJ_21_HEADBAND = 21
34 };
35 
36 class Objects {
37  Common::Array<int16> _objectVar;
38  Common::Array<Common::Point> _moveObjectXY;
39  Common::Array<uint8> _moveObjectRoom;
40  Common::U32StringArray _objectNames;
41 
42 public:
43  Common::Array<int16> _objectRunningCode;
44 
45  static constexpr int MAX_MOVED_OBJECTS = 42;
46  static constexpr int MAX_OBJECTS = 199;
47  Objects();
48  void reset();
49  void loadObjectNames();
50 
52 
53  void setVar(uint16 varIdx, int16 newValue);
54  int16 getVar(uint16 varIdx);
55 
56  int16 getObjectRunningCode(int idx);
57  void setObjectRunningCode(int idx, int16 value);
58 
59  Common::Point getMoveObjectPosition(uint8 objIdx);
60  void setMoveObjectPosition(uint8 objIdx, const Common::Point &newPoint);
61  void setMoveObjectX(uint8 objIdx, int16 xPos);
62  int getEyeDescriptionTosIdx(uint16 objNum);
63 
64  int getMoveObjectRoom(uint16 idx);
65  void setMoveObjectRoom(uint16 idx, uint8 value);
66 
67  const Common::U32String &getObjectName(int idx);
68 
69  int16 &operator[](uint16 varIdx);
70  const int16 &operator[](uint16 varIdx) const;
71 
72 private:
73  void loadKoreanObjectNames();
74  void loadChineseObjectNames();
75 
76  Common::U32String readU32String(Common::SeekableReadStream &readStream);
77 };
78 
79 } // namespace Darkseed
80 
81 #endif // DARKSEED_OBJECTS_H
Definition: objects.h:36
Definition: error.h:84
Definition: stream.h:745
Definition: serializer.h:79
Definition: ustr.h:57
Definition: rect.h:45
Definition: adlib_dsf.h:27