18 lines
584 B
C#
18 lines
584 B
C#
|
namespace Encompass.Engines
|
||
|
{
|
||
|
internal class ComponentUpdater<TComponent> : Engine where TComponent : struct, IComponent
|
||
|
{
|
||
|
public ComponentUpdater() : base()
|
||
|
{
|
||
|
receiveTypes.Add(typeof(ComponentUpdateMessage<TComponent>));
|
||
|
}
|
||
|
|
||
|
public override void Update(double dt)
|
||
|
{
|
||
|
foreach (var componentUpdateMessage in ReadMessages<ComponentUpdateMessage<TComponent>>())
|
||
|
{
|
||
|
UpdateComponentInWorld(componentUpdateMessage.componentID, componentUpdateMessage.component);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|