private void ProcessSection(IComponentSection section) { if (section == null) { return; } Parallel.ForEach( section.GetComponents(), component => engineActor.UpdateComponent(component, RunMode.Synchronous)); }
/// <remarks> /// TODO: The following commented out portion is an alternative method which *may* /// be more efficient (as it'll be looking at less directions). Need to ensure /// this area is fully tested before dropping this in and confirming: /// var lDirections = xiSection /// .GetType() /// .GetFields() /// .Select(field => field.GetCustomAttribute<DirectionAttribute>()) /// .Where(attribute => attribute != null) /// .Select(attribute => attribute.Direction); /// foreach (var lDirection in lDirections) /// { /// AddDirectionalComponent(new T(), lDirection); /// } /// </remarks> private void ProcessComponent(IComponentSection section) { foreach (eDirection direction in Enum.GetValues(typeof(eDirection))) { var component = section.GetComponentSectionInDirection(direction); if (component != null) { AddDirectionalComponent(new DirectionalComponent(component.ComponentType, direction)); } } }