Exemplo n.º 1
0
        internal static IEnumerable <IBuildSettingsComponent> GetComponents(BuildSettings settings, Type type)
        {
            var lookup = new Dictionary <Type, IBuildSettingsComponent>();

            foreach (var dependency in settings.GetDependencies())
            {
                foreach (var component in dependency.Components)
                {
                    var componentType = component.GetType();
                    if (type.IsAssignableFrom(componentType))
                    {
                        lookup[componentType] = CopyComponent(component);
                    }
                }
            }

            foreach (var component in settings.Components)
            {
                var componentType = component.GetType();
                if (type.IsAssignableFrom(componentType))
                {
                    lookup[componentType] = CopyComponent(component);
                }
            }

            return(lookup.Values);
        }