docs(codecs): セーブデータコーデック基盤へのXMLドキュメントコメント付与および実装スタイルの整理
This commit is contained in:
1 parent
922f669191
commit
ee7b37323c
4 files changed
+175
-42
No files matched your search
@@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using GameLauncher.Engines.Unity;
|
||||
using GameLauncher.Models;
|
||||
using GameLauncher.Services.Codecs;
|
||||
using GameLauncher.Engines.Unity;
|
||||
using GameLauncher.Engines.Wolf;
|
||||
|
||||
namespace GameLauncher.Services
|
||||
{
|
||||
@@ -15,23 +14,32 @@ namespace GameLauncher.Services
|
||||
/// </summary>
|
||||
public class SaveDataCodecManager
|
||||
{
|
||||
/// <summary>
|
||||
/// シングルトンインスタンスを取得します。
|
||||
/// </summary>
|
||||
public static readonly SaveDataCodecManager Instance = new();
|
||||
|
||||
private readonly List<ISaveDataCodec> _codecs = [];
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="SaveDataCodecManager"/> クラスの新しいインスタンスを初期化します。
|
||||
/// </summary>
|
||||
public SaveDataCodecManager()
|
||||
{
|
||||
// コーデックの登録
|
||||
_codecs.Add(new EasySave3Codec());
|
||||
_codecs.Add(new YurisSaveCodec());
|
||||
this._codecs.Add(new EasySave3Codec());
|
||||
this._codecs.Add(new YurisSaveCodec());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 指定されたゲームおよびセーブファイルに対応するコーデックを検索します。
|
||||
/// </summary>
|
||||
/// <param name="game">対象のUnityゲーム情報</param>
|
||||
/// <param name="file">対象のセーブファイル情報</param>
|
||||
/// <returns>対応するコーデック。見つからない場合は null</returns>
|
||||
public ISaveDataCodec? FindCodec(UnityGameItem game, SaveFileEntry file)
|
||||
{
|
||||
foreach (var codec in _codecs)
|
||||
foreach (var codec in this._codecs)
|
||||
{
|
||||
if (codec.CanHandle(game, file))
|
||||
{
|
||||
@@ -44,6 +52,9 @@ namespace GameLauncher.Services
|
||||
/// <summary>
|
||||
/// 未対応セーブデータについて、Antigravity IDE に依頼できる安全なプロンプトを自動生成します。
|
||||
/// </summary>
|
||||
/// <param name="game">対象のUnityゲーム情報</param>
|
||||
/// <param name="file">対象のセーブファイル情報</param>
|
||||
/// <returns>生成された依頼プロンプト文字列</returns>
|
||||
public string GenerateAntigravityPrompt(UnityGameItem game, SaveFileEntry file)
|
||||
{
|
||||
// ポリシー配慮: 会社名・タイトル名からセンシティブ表現を除去/安全な別名に変換
|
||||
@@ -98,8 +109,10 @@ namespace GameLauncher.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AIプロンプト向けに文字列を安全・中立的な表現にサニタイズ
|
||||
/// AIプロンプト向けに文字列を安全・中立的な表現にサニタイズします。
|
||||
/// </summary>
|
||||
/// <param name="input">元の文字列</param>
|
||||
/// <returns>サニタイズされた安全な文字列</returns>
|
||||
private static string SanitizeForPrompt(string input)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(input)) return "Game";
|
||||
|
||||
Reference in new issue
Block a user