AbyssLib 1.301
あびす謹製ノベルゲームフレームワークライブラリ
|
00001 /************************************************* 00002 ファイル名:TextManager.h 00003 作成者 :あびす 00004 役割 :既読履歴の管理 00005 *************************************************/ 00010 #ifndef ABYSSLIB_TEXTMANAGER_H 00011 #define ABYSSLIB_TEXTMANAGER_H 00012 00013 namespace nsAbyssLib{ 00014 namespace nsTextManager{ 00015 00016 //履歴データ 00020 struct Record{ 00024 TextTokenSection Text; 00028 TextTokenSection Talker; 00032 vector_mystr VoiceFileName; 00033 00037 Record(){ 00038 Clear(); 00039 } 00043 void Clear(){ 00044 Text.clear(); 00045 Talker.clear(); 00046 VoiceFileName.clear(); 00047 } 00048 }; 00049 00050 //既読履歴管理(インターフェース) 00057 class ITextManager{ 00058 public: 00059 //スキップ 00065 virtual bool GetSkip() const = 0; //スキップを取得 00071 virtual void SetSkip(bool IsSkip) = 0; //スキップを設定 00072 //強制スキップ 00080 virtual bool GetForceSkip() const = 0; //強制スキップを取得 00088 virtual void SetForceSkip(bool IsForceSkip) = 0; //強制スキップを設定 00089 //オートモードの有無 00097 virtual bool GetAutoMode() const = 0; //オートモードの有無を取得 00105 virtual void SetAutoMode(bool IsAutoMode) = 0; //オートモードの有無を設定 00106 //オートモードの待機時間 00111 virtual unsigned int GetAutoModeTime() const = 0; //オートモードの待機時間を取得 00116 virtual void SetAutoModeTime(unsigned int Time) = 0; //オートモードの待機時間を設定 00117 //ログの最大保持数 00124 virtual unsigned int GetKidokuMaxLog() const = 0; //ログの最大保持数を取得 00131 virtual void SetKidokuMaxLog(unsigned int NumMaxLog) = 0; //ログの最大保持数を設定 00132 //既読記録 00139 virtual void AddRecord(unsigned int Iterator) = 0; //記録に追加 00147 virtual bool IsExistRecord(unsigned int Iterator) const = 0; //既読かを判定 00148 //ログのイテレータ 00156 virtual void AddReadIterator(int Iterator) = 0; //イテレータを加減 00163 virtual unsigned int GetReadIterator() const = 0; //イテレータを取得 00171 virtual void SetReadIterator(unsigned int Iterator) = 0; //イテレータを設定 00172 //ログ 00176 virtual void ClearRecordData() = 0; //ログを消去 00181 virtual bool IsEmptyRecordData() const = 0; //ログが空か? 00190 virtual const Record& GetRecordData() const = 0; //ログを取得 00195 virtual void AddRecordData(const Record& Data) = 0; //ログを追加 00196 }; 00197 00198 //既読履歴管理 00204 class TextManager : public ITextManager{ 00205 public: 00209 TextManager(); //デフォルトコンストラクタ 00210 00214 void Initialize(); //初期化 00215 00216 bool GetSkip() const; //スキップを取得 00217 void SetSkip(bool IsSkip); //スキップを設定 00218 00219 bool GetForceSkip() const; //強制スキップを取得 00220 void SetForceSkip(bool IsForceSkip); //強制スキップを設定 00221 00222 bool GetAutoMode() const; //オートモードの有無を取得 00223 void SetAutoMode(bool IsAutoMode); //オートモードの有無を設定 00224 00225 unsigned int GetAutoModeTime() const; //オートモードの待機時間を取得 00226 void SetAutoModeTime(unsigned int Time); //オートモードの待機時間を設定 00227 00228 unsigned int GetKidokuMaxLog() const; //ログの最大保持数を取得 00229 void SetKidokuMaxLog(unsigned int NumMaxLog); //ログの最大保持数を設定 00230 00231 void AddRecord(unsigned int Iterator); //記録に追加 00232 bool IsExistRecord(unsigned int Iterator) const; //既読かを判定 00233 00234 void AddReadIterator(int Iterator); //イテレータを加減 00235 unsigned int GetReadIterator() const; //イテレータを取得 00236 void SetReadIterator(unsigned int Iterator); //イテレータを設定 00237 00238 void ClearRecordData(); //ログを消去 00239 bool IsEmptyRecordData() const; //ログが空か? 00240 const Record& GetRecordData() const; //ログを取得 00241 void AddRecordData(const Record& Data); //ログを追加 00242 00247 void SaveE(IIOStream* IOStream); //保存(環境設定) 00252 void LoadE(IIOStream* IOStream); //読み込み(環境設定) 00258 bool SaveK(const string& FileName, IIOStream* IOStream); //保存(既読履歴) 00264 bool LoadK(const string& FileName, IIOStream* IOStream); //読み込み(既読履歴) 00269 void SaveL(IIOStream* IOStream); //保存(ローカル) 00274 void LoadL(IIOStream* IOStream); //読み込み(ローカル) 00275 private: 00276 bool m_IsSkip; //スキップの有無 00277 bool m_ForceSkip; //強制スキップの有無 00278 bool m_IsAutoMode; //オートモードの有無 00279 unsigned int m_AutoModeTime; //オートモードの待機時間 00280 unsigned int m_KidokuMaxLog; //ログの最大保持数 00281 vector<unsigned int> m_Record; //既読記録 00282 unsigned int m_ReadIterator; //ログのイテレータ 00283 vector<Record> m_RecordData; //ログ 00284 00285 TextManager(const TextManager&); //コピーコンストラクタ(禁止) 00286 TextManager& operator =(const TextManager&); //代入演算子(禁止) 00287 }; 00288 00289 } 00290 } 00291 00292 #endif