Adds several new scripts
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Dynamic.ScriptHandling;
|
||||
@@ -26,7 +27,12 @@ public interface IScriptSet : IEnumerable<ScriptContainer>
|
||||
/// Gets a script from the set using its unique name.
|
||||
/// </summary>
|
||||
ScriptContainer? Get(StringKey scriptKey);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a script from the set using its type.
|
||||
/// </summary>
|
||||
T? Get<T>() where T : Script;
|
||||
|
||||
/// <summary>
|
||||
/// Removes a script from the set using its unique name.
|
||||
/// </summary>
|
||||
@@ -107,6 +113,9 @@ public class ScriptSet : IScriptSet
|
||||
/// <inheritdoc />
|
||||
public ScriptContainer? Get(StringKey scriptKey) => _scripts.FirstOrDefault(s => s.Script?.Name == scriptKey);
|
||||
|
||||
/// <inheritdoc />
|
||||
public T? Get<T>() where T : Script => Get(ScriptUtils.ResolveName<T>())?.Script as T;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Remove(StringKey scriptKey)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user