diff options
Diffstat (limited to 'engines/lure/res_struct.h')
-rw-r--r-- | engines/lure/res_struct.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 9190912f5b..685c55ab13 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -28,6 +28,7 @@ #include "common/list.h" #include "common/file.h" #include "common/ptr.h" +#include "common/str-array.h" #include "common/textconsole.h" namespace Lure { @@ -850,22 +851,19 @@ enum StringEnum {S_CREDITS = 25, S_RESTART_GAME = 26, S_SAVE_GAME = 27, S_RESTOR class StringList { private: - MemoryBlock *_data; - int _numEntries; - char **_entries; + Common::StringArray _entries; public: - StringList() { _numEntries = 0; } - ~StringList() { clear(); } + StringList() {} void load(MemoryBlock *data); void clear(); - int count() { return _numEntries; } + int count() { return _entries.size(); } const char *getString(int index) { - if ((index < 0) || (index >= _numEntries)) error("Invalid index specified to String List"); - return _entries[index]; + return _entries[index].c_str(); } const char *getString(Action action) { return getString((int) action - 1); } const char *getString(StringEnum sEnum) { return getString((int) sEnum); } + void setString(Action action, const Common::String &s) { _entries[(int)action - 1] = s; } }; // The following class holds the field list used by the script engine as |