ILevelReader

interface ILevelReader

The level reader interface that supplies services for reading level formats and returning a list of entities.

System.Collections.Generic.IEnumerable<IEntity> Read(System.IO.Stream stream, System.Object context)

Read the specified stream and return a list of constructed entities.

Parameters:
  • stream (System.IO.Stream) – The stream which contains level data.
  • context (System.Object) – The context in which entities are being spawned in the hierarchy. This is usually the current world, but it doesn’t have to be (e.g. if you wanted to load a level under an entity group, you would pass the entity group here).
Returns:

A list of entities to spawn within the world.

System.Collections.Generic.IEnumerable<IEntity> Read(System.IO.Stream stream, System.Object context, System.Func<IPlan, Object, Boolean> filter)

Read the specified stream and return a list of constructed entities, filtering the entities during loading.

Parameters:
  • stream (System.IO.Stream) – The stream which contains level data.
  • context (System.Object) – The context in which entities are being spawned in the hierarchy. This is usually the current world, but it doesn’t have to be (e.g. if you wanted to load a level under an entity group, you would pass the entity group here).
  • Object, Boolean> filter (System.Func<IPlan,) – A filter to apply to the dependency injection plans before they are resolved.
Returns:

A list of entities to spawn within the world.