PkmnLibRSharp/PkmnLibRSharp/DynamicData/Libraries/ScriptResolver.cs

36 lines
1.3 KiB
C#

using System;
using PkmnLibSharp.FFI;
using PkmnLibSharp.Utils;
using Interface = PkmnLibSharp.FFI.DynamicData.Libraries.ScriptResolver;
namespace PkmnLibSharp.DynamicData.Libraries
{
/// <summary>
/// A script resolver deals with the resolving of scripts. These scripts are non-hardcoded
/// implementations of different effects in Pokemon. This allows for things such as generational
/// differences, and custom implementations.
/// </summary>
public abstract class ScriptResolver : HandleType
{
/// <inheritdoc cref="ScriptResolver"/>
protected ScriptResolver(FFIHandle handle) : base(handle){}
}
/// <summary>
/// An implementation of a script resolver that pretends there are no existing scripts.
/// </summary>
public class EmptyScriptResolver : ScriptResolver
{
/// <inheritdoc cref="EmptyScriptResolver"/>
protected EmptyScriptResolver(FFIHandle handle) : base(handle){}
/// <summary>
/// Creates a new empty script resolver.
/// </summary>
public static EmptyScriptResolver Create()
{
var handle = Interface.empty_script_resolver_new();
return Resolver.Instance.ResolveEmptyScriptResolver(handle.Resolve());
}
}
}