docs(codecs): セーブデータコーデック基盤へのXMLドキュメントコメント付与および実装スタイルの整理
This commit is contained in:
1 parent
922f669191
commit
ee7b37323c
4 files changed
+175
-42
No files matched your search
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using GameLauncher.Models;
|
||||
using GameLauncher.Engines.Unity;
|
||||
using GameLauncher.Models;
|
||||
|
||||
namespace GameLauncher.Services.Codecs
|
||||
{
|
||||
@@ -12,12 +12,27 @@ namespace GameLauncher.Services.Codecs
|
||||
/// </summary>
|
||||
public class YurisSaveCodec : ISaveDataCodec
|
||||
{
|
||||
/// <summary>
|
||||
/// コーデックの表示名を取得します。
|
||||
/// </summary>
|
||||
public string CodecName => "YU-RIS セーブデータ (YSSD) コーデック";
|
||||
|
||||
/// <summary>
|
||||
/// パスワード入力が必要かどうかを取得します。
|
||||
/// </summary>
|
||||
public bool RequiresPassword => false;
|
||||
|
||||
/// <summary>
|
||||
/// パスワード入力ダイアログに表示する案内メッセージを取得します。
|
||||
/// </summary>
|
||||
public string? PasswordPromptMessage => null;
|
||||
|
||||
/// <summary>
|
||||
/// 指定されたセーブファイルが本コーデックで処理可能かを判定します。
|
||||
/// </summary>
|
||||
/// <param name="game">対象のUnityゲーム情報</param>
|
||||
/// <param name="file">対象のセーブファイル情報</param>
|
||||
/// <returns>処理可能な場合は true、それ以外は false</returns>
|
||||
public bool CanHandle(UnityGameItem game, SaveFileEntry file)
|
||||
{
|
||||
if (!File.Exists(file.FilePath)) return false;
|
||||
@@ -39,6 +54,12 @@ namespace GameLauncher.Services.Codecs
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// セーブファイルからプロパティ一覧を読み込みます。
|
||||
/// </summary>
|
||||
/// <param name="filePath">セーブファイルの絶対パス</param>
|
||||
/// <param name="optionalPassword">任意の暗号化パスワード</param>
|
||||
/// <returns>展開されたセーブデータプロパティのリスト</returns>
|
||||
public List<SaveDataPropertyEntry> LoadProperties(string filePath, string? optionalPassword = null)
|
||||
{
|
||||
var list = new List<SaveDataPropertyEntry>();
|
||||
@@ -101,6 +122,13 @@ namespace GameLauncher.Services.Codecs
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 編集後のプロパティ一覧をセーブファイルへ書き戻して保存します。
|
||||
/// </summary>
|
||||
/// <param name="filePath">保存先セーブファイルの絶対パス</param>
|
||||
/// <param name="properties">編集されたプロパティ一覧</param>
|
||||
/// <param name="optionalPassword">任意の暗号化パスワード</param>
|
||||
/// <returns>保存に成功した場合は true、それ以外は false</returns>
|
||||
public bool SaveProperties(string filePath, List<SaveDataPropertyEntry> properties, string? optionalPassword = null)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in new issue
Block a user