aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/res_struct.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lure/res_struct.cpp')
-rw-r--r--engines/lure/res_struct.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index af13135f61..1123712811 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -692,6 +692,34 @@ TalkEntryData *TalkData::getResponse(int index) {
return *i;
}
+// The following class acts as a container for all the NPC conversations
+
+void TalkDataList::saveToStream(WriteStream *stream) {
+ TalkDataList::iterator i;
+ for (i = begin(); i != end(); ++i) {
+ TalkData *rec = *i;
+ TalkEntryList::iterator i;
+
+ for (i = rec->entries.begin(); i != rec->entries.end(); ++i) {
+ TalkEntryData *entry = *i;
+ stream->writeUint16LE(entry->descId);
+ }
+ }
+}
+
+void TalkDataList::loadFromStream(ReadStream *stream) {
+ TalkDataList::iterator i;
+ for (i = begin(); i != end(); ++i) {
+ TalkData *rec = *i;
+ TalkEntryList::iterator i;
+
+ for (i = rec->entries.begin(); i != rec->entries.end(); ++i) {
+ TalkEntryData *entry = *i;
+ entry->descId = stream->readUint16LE();
+ }
+ }
+}
+
// The following class handles a set of coordinates a character should walk to
// if they're to exit a room to a designated secondary room