2019-08-01 22:06:19 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Encompass
|
|
|
|
|
{
|
2019-10-24 19:48:36 +00:00
|
|
|
|
/// <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
|
2019-08-01 22:06:19 +00:00
|
|
|
|
{
|
2020-03-20 21:13:26 +00:00
|
|
|
|
public abstract void Render(Entity entity, in TComponent drawComponent);
|
2019-08-01 22:06:19 +00:00
|
|
|
|
|
2020-03-20 07:58:33 +00:00
|
|
|
|
internal void InternalRender(Entity entity)
|
2019-08-01 22:06:19 +00:00
|
|
|
|
{
|
2020-03-20 07:58:33 +00:00
|
|
|
|
Render(entity, GetComponent<TComponent>(entity));
|
2019-08-01 22:06:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|