コード例 #1
0
ファイル: TestingClass.cs プロジェクト: valkiria88/Astoria
        private bool getWorkerPath(ref Worker w, string command)
        {
            string resp;

            if (command.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length < 2)
            {
                Console.WriteLine("Please enter a node to get the path of");
                resp = Console.ReadLine();
            }
            else
            {
                resp = command.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[1];
            }

            UInt32 ASN;
            if (!UInt32.TryParse(resp, out ASN))
            {
                Console.WriteLine("invalid ASN.");
                return false;
            }

            Console.WriteLine("Path from " + ASN + " in the worker is " + w.GetPath(ASN));
            return true;
        }