diff --git a/EduNetworkBuilder/EduNetworkBuilder.csproj b/EduNetworkBuilder/EduNetworkBuilder.csproj index ca3708b..9c57274 100644 --- a/EduNetworkBuilder/EduNetworkBuilder.csproj +++ b/EduNetworkBuilder/EduNetworkBuilder.csproj @@ -177,6 +177,7 @@ RTFWindow.cs + Form diff --git a/EduNetworkBuilder/TraversalClass.cs b/EduNetworkBuilder/TraversalClass.cs new file mode 100644 index 0000000..9a3afc8 --- /dev/null +++ b/EduNetworkBuilder/TraversalClass.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EduNetworkBuilder +{ + public class TraversalClass + { + protected struct TraversalRecord + { + public string host; + public TraversalTechnology WhatUsed; + + public TraversalRecord(string Host, TraversalTechnology what) + { + host = Host; + WhatUsed = what; + } + } + + List PathTaken = new List(); + + public TraversalClass(){ } + + public TraversalClass(TraversalClass CloneFrom) + { + Clone(CloneFrom, this); + } + + public TraversalClass Clone() + { + TraversalClass newClass = new TraversalClass(this); + return newClass; + } + + public static void Clone(TraversalClass source, TraversalClass dest) + { + dest.PathTaken.AddRange(source.PathTaken); + } + + public void AddPath(string Host, TraversalTechnology WithWhat) + { + PathTaken.Add(new TraversalRecord(Host, WithWhat)); + } + + /// + /// This is just a debug function to print off the whole path as we find it. + /// + public void DumpPath() + { + foreach(TraversalRecord one in PathTaken) + { + Console.WriteLine(string.Format("{0:12} : {1:-12}",one.host, one.WhatUsed.ToString())); + } + } + } +}