encompass-cs/encompass-cs/Renderers/OrderedRenderer.cs

18 lines
556 B
C#
Raw Normal View History

using System;
namespace Encompass
{
/// <summary>
/// OrdereredRenderer provides a structure for the common pattern of wishing to draw a specific DrawComponent at a specific layer.
/// </summary>
2020-03-20 22:45:58 +00:00
public abstract class OrderedRenderer<TComponent> : Renderer where TComponent : unmanaged, IDrawableComponent
{
2020-03-20 21:13:26 +00:00
public abstract void Render(Entity entity, in TComponent drawComponent);
internal void InternalRender(Entity entity)
{
Render(entity, GetComponent<TComponent>(entity));
}
}
}