22 #ifndef MADE_DATABASE_H 23 #define MADE_DATABASE_H 25 #include "common/hashmap.h" 28 class SeekableReadStream;
44 virtual int load(byte *source) = 0;
46 virtual uint16 getFlags() = 0;
47 virtual uint16 getClass() = 0;
48 virtual uint16 getSize() = 0;
49 virtual byte getCount1() = 0;
50 virtual byte getCount2() = 0;
51 virtual byte *getData() = 0;
52 virtual bool isConstant() = 0;
54 const char *getString();
55 void setString(
const char *str);
60 int16 getVectorSize();
61 int16 getVectorItem(int16 index);
62 void setVectorItem(int16 index, int16 value);
75 int load(byte *source)
override;
77 uint16 getFlags()
override;
78 uint16 getClass()
override;
79 uint16 getSize()
override;
80 byte getCount1()
override;
81 byte getCount2()
override;
82 byte *getData()
override;
84 bool isConstant()
override {
97 int load(byte *source)
override;
99 uint16 getFlags()
override;
100 uint16 getClass()
override;
101 uint16 getSize()
override;
102 byte getCount1()
override;
103 byte getCount2()
override;
104 byte *getData()
override;
106 bool isConstant()
override {
107 return !(getFlags() & 1);
118 void open(
const char *filename);
119 void openFromRed(
const char *redFilename,
const char *filename);
123 Object *getObject(int16 index)
const {
125 return _objects[index - 1];
130 uint getObjectCount()
const {
return _objects.size(); }
132 int16 getMainCodeObjectIndex()
const {
return _mainCodeObjectIndex; }
134 int16 getVar(int16 index);
135 void setVar(int16 index, int16 value);
137 const char *getObjectString(int16 index);
138 void setObjectString(int16 index,
const char *str);
140 virtual int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) = 0;
141 int16 *findObjectPropertyCached(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
142 virtual const char *getString(uint16 offset) = 0;
143 virtual bool getSavegameDescription(
const char *filename,
Common::String &description, int16 version) = 0;
144 virtual int16 savegame(
const char *filename,
const char *description, int16 version) = 0;
145 virtual int16 loadgame(
const char *filename, int16 version) = 0;
147 int16 getObjectProperty(int16 objectIndex, int16 propertyId);
148 int16 setObjectProperty(int16 objectIndex, int16 propertyId, int16 value);
150 void dumpObject(int16 index);
156 ObjectPropertyCacheMap _objectPropertyCache;
158 uint32 _gameStateSize;
159 int16 _mainCodeObjectIndex;
170 int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag)
override;
171 const char *getString(uint16 offset)
override;
172 bool getSavegameDescription(
const char *filename,
Common::String &description, int16 version)
override;
173 int16 savegame(
const char *filename,
const char *description, int16 version)
override;
174 int16 loadgame(
const char *filename, int16 version)
override;
184 int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag)
override;
185 const char *getString(uint16 offset)
override;
186 bool getSavegameDescription(
const char *filename,
Common::String &description, int16 version)
override;
187 int16 savegame(
const char *filename,
const char *description, int16 version)
override;
188 int16 loadgame(
const char *filename, int16 version)
override;
191 uint32 _gameStateOffs;
Definition: database.h:89
Definition: database.h:181
Definition: database.h:112
Definition: database.h:72
Definition: database.h:37
Definition: algorithm.h:29
Definition: database.h:166
Definition: database.h:94