encompass-cs/src/World.cs

39 lines
1.0 KiB
C#

using System.Collections.Generic;
namespace Encompass
{
public class World
{
private List<Engine> engines;
private EntityManager entityManager;
private ComponentManager componentManager;
private MessageManager messageManager;
internal World(
List<Engine> engines,
EntityManager entityManager,
ComponentManager componentManager,
MessageManager messageManager
)
{
this.engines = engines;
this.entityManager = entityManager;
this.componentManager = componentManager;
this.messageManager = messageManager;
}
public void Update(float dt)
{
foreach (var engine in engines)
{
engine.Update(dt);
}
messageManager.ClearMessages();
entityManager.DestroyMarkedEntities();
componentManager.ActivateComponents();
componentManager.RemoveComponents();
}
}
}