From 4d59dcb9abdc2c2da7891977ebb5ccaedf500199 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Wed, 13 Nov 2024 15:30:22 +0300 Subject: [PATCH] fix: IBehaviour.GetBehaviours(List) --- Engine.Core/Abstract/IBehaviourController.cs | 4 ++-- Engine.Core/BehaviourController.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Engine.Core/Abstract/IBehaviourController.cs b/Engine.Core/Abstract/IBehaviourController.cs index c5ba6da..65964cd 100644 --- a/Engine.Core/Abstract/IBehaviourController.cs +++ b/Engine.Core/Abstract/IBehaviourController.cs @@ -75,8 +75,8 @@ public interface IBehaviourController : IInitialize, IAssignableGameObject, IEnu /// Gets all s of the specified type and stores them in the provided list. /// /// The type of s to get. - /// The list to store the s. - void GetBehaviours(List behaviours); + /// The list to store the s. + void GetBehaviours(IList results); /// /// Removes s of the specified type from the . diff --git a/Engine.Core/BehaviourController.cs b/Engine.Core/BehaviourController.cs index 44e1969..80e890f 100644 --- a/Engine.Core/BehaviourController.cs +++ b/Engine.Core/BehaviourController.cs @@ -95,15 +95,15 @@ public class BehaviourController : IBehaviourController return behaviours ?? Enumerable.Empty().ToList(); } - public void GetBehaviours(List behaviors) + public void GetBehaviours(IList 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); } }