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;
|
||||
|
||||
@@ -14,7 +13,6 @@ public class BehaviourCollector<T> : IBehaviourCollector<T> where T : class
|
||||
|
||||
protected readonly List<T> behaviours = new(32);
|
||||
|
||||
public IReadOnlyList<T> Behaviours => behaviours;
|
||||
public IUniverse Universe { get; private set; } = null!;
|
||||
|
||||
public BehaviourCollector() { }
|
||||
@@ -96,4 +94,7 @@ public class BehaviourCollector<T> : IBehaviourCollector<T> where T : class
|
||||
OnUnassigned?.Invoke(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public int Count => behaviours.Count;
|
||||
public T this[System.Index index] => behaviours[index];
|
||||
}
|
||||
|
Reference in New Issue
Block a user