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