add indexers for pool readonly wrappers

This commit is contained in:
DCFApixels 2025-03-29 10:15:04 +08:00
parent 63459776f2
commit c36642ad83
2 changed files with 8 additions and 0 deletions

View File

@ -418,6 +418,10 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return _pool.IsReadOnly; } get { return _pool.IsReadOnly; }
} }
public ref readonly T this[int entityID]
{
get { return ref _pool.Read(entityID); }
}
#endregion #endregion
#region Constructors #region Constructors

View File

@ -365,6 +365,10 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return _pool.IsReadOnly; } get { return _pool.IsReadOnly; }
} }
public bool this[int entityID]
{
get { return _pool.Has(entityID); }
}
#endregion #endregion
#region Constructors #region Constructors