2019-06-15 00:51:06 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2019-06-14 03:28:26 +00:00
|
|
|
namespace Encompass {
|
|
|
|
public class World {
|
2019-06-15 00:51:06 +00:00
|
|
|
private List<Engine> engines;
|
|
|
|
private EntityManager entityManager;
|
|
|
|
private ComponentManager componentManager;
|
2019-06-14 03:28:26 +00:00
|
|
|
|
2019-06-15 00:51:06 +00:00
|
|
|
internal World(
|
|
|
|
List<Engine> engines,
|
|
|
|
EntityManager entityManager,
|
|
|
|
ComponentManager componentManager
|
|
|
|
) {
|
|
|
|
this.engines = engines;
|
2019-06-15 00:03:56 +00:00
|
|
|
this.entityManager = entityManager;
|
|
|
|
this.componentManager = componentManager;
|
2019-06-14 03:28:26 +00:00
|
|
|
}
|
|
|
|
|
2019-06-15 00:51:06 +00:00
|
|
|
public void Update(float dt) {
|
|
|
|
foreach (var engine in engines) {
|
|
|
|
engine.Update(dt);
|
|
|
|
}
|
|
|
|
|
2019-06-14 05:25:05 +00:00
|
|
|
entityManager.DestroyMarkedEntities();
|
2019-06-14 03:28:26 +00:00
|
|
|
componentManager.ActivateComponents();
|
|
|
|
componentManager.RemoveComponents();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|