ordered renderer now requires IDrawComponent interface
parent
5429783633
commit
ddbfd492d3
|
@ -0,0 +1,4 @@
|
|||
namespace Encompass
|
||||
{
|
||||
public interface IDrawComponent { }
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Encompass
|
||||
{
|
||||
public abstract class OrderedRenderer<TComponent> : Renderer where TComponent : struct, IComponent
|
||||
public abstract class OrderedRenderer<TComponent> : Renderer where TComponent : struct, IComponent, IDrawComponent
|
||||
{
|
||||
public abstract void Render(Guid drawComponentID, TComponent drawComponent);
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace Encompass
|
|||
return engine;
|
||||
}
|
||||
|
||||
public OrderedRenderer<TComponent> AddOrderedRenderer<TComponent>(OrderedRenderer<TComponent> renderer) where TComponent : struct, IComponent
|
||||
public OrderedRenderer<TComponent> AddOrderedRenderer<TComponent>(OrderedRenderer<TComponent> renderer) where TComponent : struct, IComponent, IDrawComponent
|
||||
{
|
||||
renderer.AssignEntityManager(entityManager);
|
||||
renderer.AssignComponentManager(componentManager);
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Tests
|
|||
struct BComponent : IComponent { }
|
||||
struct CComponent : IComponent { }
|
||||
|
||||
struct TestDrawComponent : IComponent { }
|
||||
struct TestDrawComponent : IComponent, IDrawComponent { }
|
||||
|
||||
class TestRenderer : OrderedRenderer<TestDrawComponent>
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Tests
|
|||
public class WorldTest
|
||||
{
|
||||
struct TestComponent : IComponent { }
|
||||
struct TestDrawComponent : IComponent { }
|
||||
struct TestDrawComponent : IComponent, IDrawComponent { }
|
||||
|
||||
static List<object> drawOrder = new List<object>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue