public void Prepare(BaseSimulation simulation) { if (simulation == null) { throw new ArgumentNullException(nameof(simulation)); } simulation.BeforeSetup += (obj, args) => { foreach (var action in BeforeSetup) { action(simulation); } }; simulation.AfterSetup += (obj, args) => { foreach (var action in AfterSetup) { action(simulation); } }; SimulationUpdates.Apply(simulation); EntityUpdates.Apply(simulation); }