refactor: behaviour collector Count and indexer accessors added
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -16,7 +15,6 @@ public class ActiveBehaviourCollector<T> : IBehaviourCollector<T> where T : clas
|
||||
protected readonly List<T> activeBehaviours = new(32);
|
||||
protected readonly Dictionary<IActive, T> monitoringActiveToBehaviour = new(32);
|
||||
|
||||
public IReadOnlyList<T> Behaviours => activeBehaviours;
|
||||
public IUniverse Universe { get; private set; } = null!;
|
||||
|
||||
public ActiveBehaviourCollector() { }
|
||||
@@ -117,4 +115,7 @@ public class ActiveBehaviourCollector<T> : IBehaviourCollector<T> where T : clas
|
||||
OnUnassigned?.Invoke(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public int Count => activeBehaviours.Count;
|
||||
public T this[System.Index index] => activeBehaviours[index];
|
||||
}
|
||||
|
Reference in New Issue
Block a user