ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

diary.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef STARK_SERVICES_DIARY_H
00024 #define STARK_SERVICES_DIARY_H
00025 
00026 #include "common/str.h"
00027 #include "common/str-array.h"
00028 
00029 namespace Common {
00030 class SeekableReadStream;
00031 class WriteStream;
00032 }
00033 
00034 namespace Stark {
00035 
00036 class ResourceSerializer;
00037 
00043 class Diary {
00044 public:
00045     struct ConversationLogLine {
00046         Common::String line;
00047         int32 characterId;
00048 
00049         ConversationLogLine();
00050     };
00051 
00052     struct ConversationLog {
00053         Common::String title;
00054         Common::String characterName;
00055         int32 characterId;
00056         int32 chapter;
00057         bool dialogActive;
00058         Common::Array<ConversationLogLine> lines;
00059 
00060         ConversationLog();
00061     };
00062 
00063     Diary();
00064     virtual ~Diary();
00065 
00067     bool isEnabled() const;
00068 
00070     bool hasUnreadEntries() const;
00071 
00073     void setDiaryAllRead() { _hasUnreadEntries = false; }
00074 
00076     void addDiaryEntry(const Common::String &name);
00077 
00079     uint32 getPageIndex() const { return _pageIndex; };
00080     void setPageIndex(uint32 pageIndex) { _pageIndex = pageIndex; }
00081 
00083     void addFMVEntry(const Common::String &filename, const Common::String &title, int gameDisc);
00084 
00086     uint countFMV() const { return _fmvEntries.size(); }
00087     const Common::String &getFMVFilename(uint index) const { return _fmvEntries[index].filename; }
00088     const Common::String &getFMVTitle(uint index) const { return _fmvEntries[index].title; }
00089 
00091     uint countDiary() const { return _diaryEntries.size(); }
00092     const Common::String &getDiary(uint index) const { return _diaryEntries[index]; }
00093 
00095     uint countDialog() const { return _conversationEntries.size(); }
00096     const ConversationLog &getDialog(uint index) const { return _conversationEntries[index]; }
00097 
00099     void openDialog(const Common::String &title, const Common::String &characterName, int32 characterId);
00100 
00102     void logSpeech(const Common::String &line, int32 characterId);
00103 
00105     void closeDialog();
00106 
00108     void clear();
00109 
00111     void readStateFromStream(Common::SeekableReadStream *stream, uint32 version);
00112 
00114     void writeStateToStream(Common::WriteStream *stream);
00115 
00116 private:
00117     struct FMVEntry {
00118         Common::String filename;
00119         Common::String title;
00120         int gameDisc;
00121     };
00122 
00123     bool hasFMVEntry(const Common::String &filename) const;
00124     void saveLoad(ResourceSerializer *serializer);
00125 
00126     Common::Array<Common::String> _diaryEntries;
00127     Common::Array<FMVEntry> _fmvEntries;
00128     Common::Array<ConversationLog> _conversationEntries;
00129 
00130     bool _hasUnreadEntries;
00131     uint32 _pageIndex;
00132 };
00133 
00134 } // End of namespace Stark
00135 
00136 #endif // STARK_SERVICES_DIARY_H


Generated on Sat Feb 23 2019 05:01:01 for ResidualVM by doxygen 1.7.1
curved edge   curved edge