Files
armonica ae86b53147 スタイル: コーディング規約に準拠したコードフォーマットの適用(this.の明示、空白スタイルの統一)
- 自インスタンスメンバーアクセスへの this. 付与(28ファイル)
- .editorconfig に準拠したインデント・波括弧・空白スタイルの適用
- UTF-8 (BOMあり)、CRLF改行コード、行末空白除去の整合性検証
2026-10-20 10:14:26 +09:00

52 lines
2.1 KiB
C#

using System;
using GameLauncher.Engines.Common;
using GameLauncher.Models;
namespace GameLauncher.Engines.Evb
{
/// <summary>
/// Engine module for Enigma Virtual Box (EVB) packed applications.
///
/// EVB is a generic packer: it can wrap a game built on any engine (RGSS, NW.js,
/// Wolf, Unity, ...). This module therefore acts as a *pre-stage* — it detects an
/// EVB-packed executable, unpacks it via the bundled evbunpack tool, and then lets
/// the caller re-detect the underlying engine from the unpacked content.
///
/// Per-game hacks never live here; they belong under
/// `Engines/Evb/Games/&lt;GameName&gt;/` and must not affect other games.
/// </summary>
public sealed class EvbEngineModule : IEngineModule
{
/// <inheritdoc />
public string EngineName => EngineDetectionHelper.EngineEvb;
/// <inheritdoc />
public bool Detect(string gameDirectory) => EvbDetector.IsEvbGame(gameDirectory);
/// <summary>
/// EVB is a packaging layer, not a game engine, so it has no script mod of its own.
/// Mods are applied by the underlying engine after unpacking.
/// </summary>
public bool ApplyMod(string gameDirectory, ModPluginDefinition plugin) => false;
/// <summary>EVB has no standalone mod state; nothing is ever "applied".</summary>
public bool IsModApplied(string gameDirectory) => false;
/// <inheritdoc />
public string ResolveToolPath(string toolFileName)
=> AppPathHelperBridge.Resolve(this.EngineName, toolFileName);
}
/// <summary>
/// Thin indirection so that <see cref="EvbEngineModule"/> can resolve engine tools
/// without taking a hard dependency on the concrete helper type in this file.
/// </summary>
internal static class AppPathHelperBridge
{
public static string Resolve(string engineName, string toolFileName)
=> Helpers.AppPathHelper.ResolveEngineTool(engineName, toolFileName)
?? throw new InvalidOperationException(
$"External tool '{toolFileName}' for engine '{engineName}' was not found.");
}
}