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/debugger.h"
27 
28 namespace Ultima {
29 namespace Ultima8 {
30 
31 enum ReservedObjId {
32  kUndefinedId = 0,
33  kMainActorId = 1,
34  kGuardianId = 666
35 };
36 
37 class Usecode;
38 
39 class Object {
40 public:
41  Object() : _objId(0xFFFF) {}
42  virtual ~Object();
43 
44  ENABLE_RUNTIME_CLASSTYPE_BASE()
45 
46 
47  inline ObjId getObjId() const {
48  return _objId;
49  }
50 
53  virtual ObjId assignObjId();
54 
56  virtual void clearObjId();
57 
59  virtual Common::String dumpInfo() const;
60 
68  ProcId callUsecode(uint16 classid, uint16 offset,
69  const uint8 *args = 0, int argsize = 0);
70 
71  bool loadData(Common::ReadStream *rs, uint32 version);
72  virtual void saveData(Common::WriteStream *ws);
73 
74 protected:
75  ObjId _objId;
76 };
77 
78 } // End of namespace Ultima8
79 } // End of namespace Ultima
80 
81 #endif
Definition: str.h:59
Definition: stream.h:77
virtual ObjId assignObjId()
Definition: detection.h:27
Definition: object.h:39
ProcId callUsecode(uint16 classid, uint16 offset, const uint8 *args=0, int argsize=0)
ObjId getObjId() const
get this Object&#39;s objID
Definition: object.h:47
virtual Common::String dumpInfo() const
dump some info about this object to a string
Definition: stream.h:385
virtual void clearObjId()
Clear objID of self and contents (if any)