public CachedWrappedStrategist( IStrategist <TNode, TPayload> baseStrategist, Func <INavigator <TNode, TPayload>, INavigator <TNode, TPayload> > getNavigator) { Contract.Requires(baseStrategist != null); Contract.Requires(getNavigator != null); this.baseStrategist = baseStrategist; this.getNavigator = getNavigator; this.cachedWrappedNavigators = new Dictionary <INavigator <TNode, TPayload>, INavigator <TNode, TPayload> >(ReferenceEqualityComparer.Instance); }
public static void Walk <TNode, TPayload>(TNode root, IStrategist <TNode, TPayload> strategySelector, TPayload payload, IEqualityComparer <TNode> equalityComparer = null) { var walk = new SelfSufficientRoute <TNode, TPayload>(strategySelector, payload, equalityComparer); walk.Visit(root); #if DEBUG DebuggingInfo = walk.DebuggingInfo; #endif }
public NavigatorDelegateRedirecter(IStrategist <TNode, TPayload> strategist) : this(strategist.ChooseNavigator) { }
public SelfSufficientRoute(IStrategist <TNode, TPayload> strategist, TPayload payload, IEqualityComparer <TNode> equalityComparer = null) : base(equalityComparer) { this.payload = payload; this.strategist = strategist; }