mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 17:38:10 +08:00
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
// ---------------------------------------------------------------------------------------------
|
|
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
|
// See LICENSE file in the project root for license information.
|
|
// ---------------------------------------------------------------------------------------------
|
|
|
|
namespace Pal3.Game.Script
|
|
{
|
|
using Core.Command;
|
|
using Core.Utilities;
|
|
using Patcher;
|
|
|
|
public sealed class PalScriptCommandPreprocessor
|
|
{
|
|
private readonly IPalScriptPatcher _patcher;
|
|
|
|
public PalScriptCommandPreprocessor(IPalScriptPatcher patcher)
|
|
{
|
|
_patcher = Requires.IsNotNull(patcher, nameof(patcher));
|
|
}
|
|
|
|
public void Process(ref ICommand command,
|
|
PalScriptType scriptType,
|
|
uint scriptId,
|
|
string scriptDescription,
|
|
long positionInScript,
|
|
int codepage)
|
|
{
|
|
if (_patcher.TryPatchCommandInScript(scriptType,
|
|
scriptId,
|
|
scriptDescription,
|
|
positionInScript,
|
|
codepage,
|
|
command,
|
|
out ICommand fixedCommand))
|
|
{
|
|
command = fixedCommand;
|
|
}
|
|
}
|
|
}
|
|
} |