private InputBuilder(InputBuildContext context, IInputBuildProcessor[] processors) { mContext = context; mInputProcessors = processors; System.Array.Sort(mInputProcessors, new PriorityComparer <IInputBuildProcessor>(true)); mState = InputBuildState.LoadComponents; }
public static InputBuilder Create(ISceneQuery filter , IInputBuildProcessor[] processors , InputBuildOption options) { IInputBuildProcessor[] lprocessors = ArrayUtil.Compress(processors); if (lprocessors == null || lprocessors.Length == 0) { return(null); } for (int i = lprocessors.Length - 1; i >= 0; i--) { IInputBuildProcessor processor = lprocessors[i]; if (processor.DuplicatesAllowed) { continue; } System.Type ta = processor.GetType(); for (int j = i - 1; j >= 0; j--) { System.Type tb = lprocessors[j].GetType(); if (ta.IsAssignableFrom(tb) || tb.IsAssignableFrom(ta)) { return(null); } } } if (lprocessors == processors) { lprocessors = (IInputBuildProcessor[])lprocessors.Clone(); } InputBuildContext context = new InputBuildContext(filter, options); return(new InputBuilder(context, lprocessors)); }