/// <summary> /// Initialize a new instance of the <see cref="StagedStrategyChain{TStrategyType, TStageEnum}"/> class with an inner strategy chain to use when building. /// </summary> /// <param name="innerChain">The inner strategy chain to use first when finding strategies in the build operation.</param> public StagedStrategyChain(IStagedStrategyChain <TStrategyType, TStageEnum>?innerChain = null) { if (null != innerChain) { _innerChain = (StagedStrategyChain <TStrategyType, TStageEnum>)innerChain; _innerChain.Invalidated += OnParentInvalidated; } for (var i = 0; i < _stages.Length; ++i) { _stages[i] = new List <TStrategyType>(); } }
/// <summary> /// Construct a <see cref="DynamicMethodBuildPlanCreatorPolicy"/> that /// uses the given strategy chain to construct the build plan. /// </summary> /// <param name="strategies">The strategy chain.</param> public DynamicMethodBuildPlanCreatorPolicy(IStagedStrategyChain strategies) { this.strategies = strategies; }
/// <summary> /// Add a new strategy for the <paramref name="stage"/>. /// </summary> /// <typeparam name="TStrategy">The <see cref="System.Type"/> of <see cref="IBuilderStrategy"/></typeparam> /// <param name="chain"></param> /// <param name="stage">The stage to add the strategy.</param> public static void AddNew <TStrategy>(this IStagedStrategyChain <UnityBuildStage> chain, UnityBuildStage stage) where TStrategy : IBuilderStrategy, new() { chain.Add(new TStrategy(), stage); }
/// <summary> /// Add a new strategy for the <paramref name="stage"/>. /// </summary> /// <typeparam name="TStrategy">The <see cref="System.Type"/> of strategy</typeparam> /// <typeparam name="TStageEnum">The stage enum</typeparam> /// <param name="chain">The chain this strategy is added to.</param> /// <param name="stage">The stage to add the strategy to.</param> public static void AddNew <TStrategy, TStageEnum>(this IStagedStrategyChain <TStrategy, TStageEnum> chain, TStageEnum stage) where TStrategy : new() { chain.Add(new TStrategy(), stage); }
/// <summary> /// Construct a <see cref="DynamicMethodBuildPlanCreatorPolicy"/> that /// uses the given strategy chain to construct the build plan. /// </summary> /// <param name="strategies">The strategy chain.</param> public DynamicMethodBuildPlanCreatorPolicy(IStagedStrategyChain <IBuilderStrategy, BuilderStage> strategies) { _strategies = strategies; }