Nez.Portable/ECS/InternalUtils/EntityList.cs
/// <summary>
/// returns a List of all Entities of type T. The returned List can be put back in the pool via ListPool.free.
/// </summary>
/// <returns>The of type.</returns>
/// <typeparam name="T">The 1st type parameter.</typeparam>
returns a List of all Entities of type T. The returned List can be put back in the pool via ListPool.free.
returns a List of all Entities of type T . The returned List can be put back in the pool via ListPool . free .
public List<Entity> entitiesOfType<T>()
            where T : Entity
        {
            var list = ListPool<Entity>.obtain();
            for (var i = 0; i < _entities.length; i++)
            {
                if (_entities.buffer[i] is T)
                    list.Add(_entities.buffer[i]);
            }
            foreach (var entity in _entitiesToAdd)
            {
                if (entity is T)
                {
                    list.Add(entity);
                }
            }
            return list;
        }
public List < Entity > entitiesOfType < T > ( ) where T : Entity { var list = ListPool < Entity > . obtain ( ) ; for ( var i = 0 ; i < _entities . length ; i ++ ) { if ( _entities . buffer [ i ] is T ) list . Add ( _entities . buffer [ i ] ) ; } foreach ( var entity in _entitiesToAdd ) { if ( entity is T ) { list . Add ( entity ) ; } } return list ; }
returns a List of all Entities of type T. The returned List can be put back in the pool via ListPool.free.
returns a List of all Entities of type T . The returned List can be put back in the pool via ListPool . free .
The of type.
The of type .
typeparam
The 1st type parameter.
The 1st type parameter .