Development Merge 2025.10.18 #4
@@ -1,6 +1,5 @@
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Syntriax.Engine.Core;
 | 
					namespace Syntriax.Engine.Core;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -50,17 +49,13 @@ public class BehaviourController : BaseEntity, IBehaviourController
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public IReadOnlyList<T> GetBehaviours<T>()
 | 
					    public IReadOnlyList<T> GetBehaviours<T>()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        List<T>? behaviours = null;
 | 
					        List<T> behaviours = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach (IBehaviour behaviourItem in this.behaviours)
 | 
					        foreach (IBehaviour behaviourItem in this.behaviours)
 | 
				
			||||||
        {
 | 
					            if (behaviourItem is T behaviour)
 | 
				
			||||||
            if (behaviourItem is not T behaviour)
 | 
					 | 
				
			||||||
                continue;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            behaviours ??= [];
 | 
					 | 
				
			||||||
                behaviours.Add(behaviour);
 | 
					                behaviours.Add(behaviour);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return behaviours ?? Enumerable.Empty<T>().ToList();
 | 
					        return behaviours;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void GetBehaviours<T>(IList<T> results)
 | 
					    public void GetBehaviours<T>(IList<T> results)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user