Some initial work on prescient AI, AI runner, and some random fixes
All checks were successful
Build / Build (push) Successful in 1m3s
All checks were successful
Build / Build (push) Successful in 1m3s
This commit is contained in:
@@ -155,7 +155,8 @@ public static class ScriptExecution
|
||||
Action<TScriptHook> hook)
|
||||
{
|
||||
List<ScriptCategory>? suppressedCategories = null;
|
||||
foreach (var container in source.SelectMany(x => x))
|
||||
var iterator = new ScriptIterator(source);
|
||||
foreach (var container in iterator)
|
||||
{
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
@@ -163,7 +164,7 @@ public static class ScriptExecution
|
||||
if (script is IScriptOnBeforeAnyHookInvoked onBeforeAnyHookInvoked)
|
||||
onBeforeAnyHookInvoked.OnBeforeAnyHookInvoked(ref suppressedCategories);
|
||||
}
|
||||
foreach (var container in source.SelectMany(x => x))
|
||||
foreach (var container in iterator)
|
||||
{
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace PkmnLib.Dynamic.ScriptHandling;
|
||||
/// We can add, remove, and clear scripts from the set.
|
||||
/// This is generally used for volatile scripts.
|
||||
/// </summary>
|
||||
public interface IScriptSet : IEnumerable<ScriptContainer>
|
||||
public interface IScriptSet : IEnumerable<ScriptContainer>, IDeepCloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a script to the set. If the script with that name already exists in this set, this
|
||||
@@ -97,15 +97,7 @@ public class ScriptSet : IScriptSet
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerator<ScriptContainer> GetEnumerator()
|
||||
{
|
||||
var currentIndex = 0;
|
||||
while (currentIndex < _scripts.Count)
|
||||
{
|
||||
yield return _scripts[currentIndex];
|
||||
currentIndex++;
|
||||
}
|
||||
}
|
||||
public IEnumerator<ScriptContainer> GetEnumerator() => _scripts.GetEnumerator();
|
||||
|
||||
/// <inheritdoc />
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
Reference in New Issue
Block a user