17 lines
643 B
C#
17 lines
643 B
C#
using System;
|
|
|
|
namespace Engine.Core;
|
|
|
|
public class ActiveBehaviourCollector<T> : ActiveBehaviourCollectorBase<T> where T : class, IBehaviour
|
|
{
|
|
protected readonly FastList<T> activeBehaviours = new(32);
|
|
public override T this[Index index] => activeBehaviours[index];
|
|
public override int Count => activeBehaviours.Count;
|
|
|
|
public ActiveBehaviourCollector() { }
|
|
public ActiveBehaviourCollector(IUniverse universe) : base(universe) { }
|
|
|
|
protected override void AddBehaviour(T behaviour) => activeBehaviours.Add(behaviour);
|
|
protected override bool RemoveBehaviour(T tBehaviour) => activeBehaviours.Remove(tBehaviour);
|
|
}
|