This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-nitride-cil/src/MfGames.Nitride/Pipelines/PipelineBase.cs

43 lines
890 B
C#
Raw Normal View History

2021-09-07 05:15:45 +00:00
using System.Collections.Generic;
2022-09-06 05:53:22 +00:00
using MfGames.Gallium;
2021-09-07 05:15:45 +00:00
2022-09-06 05:53:22 +00:00
namespace MfGames.Nitride.Pipelines;
/// <summary>
/// A basic pipeline that is configured through properties and methods.
/// </summary>
public abstract class PipelineBase : IPipeline
2021-09-07 05:15:45 +00:00
{
private readonly List<IPipeline> dependencies;
protected PipelineBase()
{
this.dependencies = new List<IPipeline>();
}
public PipelineBase AddDependency(IPipeline pipeline)
{
this.dependencies.Add(pipeline);
2022-07-09 04:52:10 +00:00
return this;
}
/// <inheritdoc />
public IEnumerable<IPipeline> GetDependencies()
{
return this.dependencies;
}
/// <inheritdoc />
public abstract IAsyncEnumerable<Entity> RunAsync(
IEnumerable<Entity> entities);
/// <inheritdoc />
public override string ToString()
2021-09-07 05:15:45 +00:00
{
2022-07-09 04:52:10 +00:00
return this.GetType()
.Name;
2021-09-07 05:15:45 +00:00
}
}