Ejemplo n.º 1
0
 public virtual void ApplyActionToEdges(Action <EdgeNode> edgeAction)
 {
     foreach (var edgeNode in EdgeNodeFactory.GetFactory().Values)
     {
         edgeAction.Invoke(edgeNode.Value);
     }
 }
Ejemplo n.º 2
0
        public E Copy <E>(EdgeNodeStateContext nodeStateContext, EdgeNodeStateContextFactory <E> factory) where E : EdgeNodeStateContext, new()
        {
            var nodeFactory = EdgeNodeFactory.GetFactory();
            var context     = factory.ConstructNodeContext(nodePosition: nodeStateContext.Node.Position,
                                                           nodeState: nodeStateContext.State, nodeFactory: nodeFactory);

            return(context);
        }
        public override E ConstructDefaultNodeContext(int nodePosition)
        {
            var factory = EdgeNodeFactory.GetFactory();
            var context = ConstructNodeContext(
                nodePosition: nodePosition,
                nodeState: UnchosenEdgeNodeState.Instance,
                nodeFactory: factory);

            return(context);
        }
        public NodeStateContextContainerFacade <E, V> Copy(NodeStateContextContainerFacade <E, V> nodeStateContextContainerFacade)
        {
            var edgeNodeFactory   = EdgeNodeFactory.GetFactory();
            var vertexNodeFactory = VertexNodeFactory.GetFactory();
            var edgeContainer     =
                nodeStateContextContainerFacade.EdgeNodeStateContextContainer.Copy(this.EdgeNodeStateContextFactory);
            var vertexContainer =
                nodeStateContextContainerFacade.VertexNodeStateContextContainer.Copy(this.VertexNodeStateContextFactory);
            var newFacade = new NodeStateContextContainerFacade <E, V>(edgeContainer, vertexContainer);

            return(newFacade);
        }
        public E ConstructNodeContext(int nodePosition, NodeState nodeState)
        {
            var nodeFactory = EdgeNodeFactory.GetFactory();

            return(base.ConstructNodeContext(nodePosition, nodeState, nodeFactory));
        }