fix: IBehaviour.GetBehaviours<T>(List)

This commit is contained in:
2024-11-13 15:30:22 +03:00
parent 1b3b999a95
commit 4d59dcb9ab
2 changed files with 6 additions and 6 deletions

View File

@@ -95,15 +95,15 @@ public class BehaviourController : IBehaviourController
return behaviours ?? Enumerable.Empty<T>().ToList();
}
public void GetBehaviours<T>(List<T> behaviors)
public void GetBehaviours<T>(IList<T> results)
{
behaviors.Clear();
results.Clear();
foreach (var behaviourItem in behaviours)
{
if (behaviourItem is not T _)
if (behaviourItem is not T behaviour)
continue;
behaviours.Add(behaviourItem);
results.Add(behaviour);
}
}