38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Text;
|
|||
|
|
|||
|
namespace Encompass
|
|||
|
{
|
|||
|
public abstract class Renderer
|
|||
|
{
|
|||
|
private EntityManager entityManager;
|
|||
|
private ComponentManager componentManager;
|
|||
|
|
|||
|
internal void AssignEntityManager(EntityManager entityManager)
|
|||
|
{
|
|||
|
this.entityManager = entityManager;
|
|||
|
}
|
|||
|
|
|||
|
internal void AssignComponentManager(ComponentManager componentManager)
|
|||
|
{
|
|||
|
this.componentManager = componentManager;
|
|||
|
}
|
|||
|
|
|||
|
protected Entity GetEntity(Guid entityID)
|
|||
|
{
|
|||
|
return entityManager.GetEntity(entityID);
|
|||
|
}
|
|||
|
|
|||
|
protected IEnumerable<KeyValuePair<Guid, TComponent>> ReadComponents<TComponent>() where TComponent : struct, IComponent
|
|||
|
{
|
|||
|
return componentManager.GetActiveComponentsByType<TComponent>();
|
|||
|
}
|
|||
|
|
|||
|
protected KeyValuePair<Guid, TComponent> ReadComponent<TComponent>() where TComponent : struct, IComponent
|
|||
|
{
|
|||
|
return componentManager.GetActiveComponentByType<TComponent>();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|