source: trunk/CrypPlugins/WorkspaceManager/View/VisualComponents/CryptoLineView/StackFrameDijkstra/NodeState.cs @ 1927

Last change on this file since 1927 was 1927, checked in by matkovic, 11 years ago

-added PowerCollection library
-added QuadTree
-improved path finding performance

File size: 759 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace WorkspaceManager.View.VisualComponents.StackFrameDijkstra
7{
8    class NodeState<T> where T:Node<T> {
9
10        public readonly T Node;
11        public NodeState<T> previous{get;set;}
12
13        public NodeState(T node, NodeState<T> previous) {
14            this.Node = node;
15            this.previous = previous;
16        }
17
18        public LinkedList<T> makePath()
19        {
20            LinkedList<T> result = new LinkedList<T>();
21            NodeState<T> s = this;
22            while (s != null) {
23                result.AddFirst(s.Node);
24                s = s.previous;
25            }
26
27            return result;
28        }
29
30    }
31
32}
Note: See TracBrowser for help on using the repository browser.