ScummVM API documentation
object.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 ULTIMA8_KERNEL_OBJECT_H
23#define ULTIMA8_KERNEL_OBJECT_H
24
25#include "ultima/ultima8/misc/classtype.h"
26#include "ultima/ultima8/misc/common_types.h"
27#include "ultima/ultima8/misc/debugger.h"
28
29namespace Common {
30class ReadStream;
31}
32
33namespace Ultima {
34namespace Ultima8 {
35
36enum ReservedObjId {
37 kUndefinedId = 0,
38 kMainActorId = 1,
39 kGuardianId = 666
40};
41
42class Usecode;
43
44class Object {
45public:
46 Object() : _objId(0xFFFF) {}
47 virtual ~Object();
48
49 ENABLE_RUNTIME_CLASSTYPE_BASE()
50
51
52 inline ObjId getObjId() const {
53 return _objId;
54 }
55
58 virtual ObjId assignObjId();
59
61 virtual void clearObjId();
62
64 virtual Common::String dumpInfo() const;
65
73 ProcId callUsecode(uint16 classid, uint16 offset,
74 const uint8 *args = 0, int argsize = 0);
75
76 bool loadData(Common::ReadStream *rs, uint32 version);
77 virtual void saveData(Common::WriteStream *ws);
78
79protected:
80 ObjId _objId;
81};
82
83} // End of namespace Ultima8
84} // End of namespace Ultima
85
86#endif
Definition: stream.h:385
Definition: str.h:59
Definition: stream.h:77
Definition: object.h:44
ProcId callUsecode(uint16 classid, uint16 offset, const uint8 *args=0, int argsize=0)
virtual Common::String dumpInfo() const
dump some info about this object to a string
ObjId getObjId() const
get this Object's objID
Definition: object.h:52
virtual ObjId assignObjId()
virtual void clearObjId()
Clear objID of self and contents (if any)
Definition: algorithm.h:29