public void Begin() { if (_nextWorld != null) { if (_nextWorldTask != null && _nextWorldTask.IsCompleted) { if (_nextWorldTask.IsFaulted) { throw new AggregateException(_nextWorldTask.Exception); } if (_nextWorldTask.IsCanceled) { throw new OperationCanceledException("The operation to switch the world was cancelled."); } } World?.Dispose(); World = _nextWorld; _analyticsEngine.LogGameplayEvent("World:Switch:" + World.GetType().Name); _nextWorld = null; } }
/// <summary> /// Handles the beginning of a step, switching out the current world for <see cref="_nextWorld"/> /// if required. /// </summary> public void Begin() { if (_nextWorld != null) { World?.Dispose(); World = _nextWorld; _nextWorld = null; } }
public void Begin() { if (_nextWorld != null) { World?.Dispose(); World = _nextWorld; _analyticsEngine.LogGameplayEvent("World:Switch:" + World.GetType().Name); _nextWorld = null; } }