コード例 #1
0
        protected string GetPath()
        {
            var steps = new Stack <string>();

            CraftingNode node = this;

            while (node != null)
            {
                steps.Push(node.Name);
                node = node.Parent;
            }

            string path = string.Empty;

            while (steps.Count > 0)
            {
                path += steps.Pop() + Splitter;
            }

            path.TrimEnd(Splitter);

            return(path);
        }
コード例 #2
0
        protected string GetPath()
        {
            var steps = new Stack <string>(4);
            // Currently the deepest trees in the standard fabricators only go 3 deep

            CraftingNode node = this;

            while (node != null)
            {
                steps.Push(node.Name);
                node = node.Parent;
            }

            string path = string.Empty;

            while (steps.Count > 0)
            {
                path += steps.Pop() + Splitter;
            }

            path.TrimEnd(Splitter);

            return(path);
        }
コード例 #3
0
 internal CraftingTab(CraftingNode parent, string tabName) : base(parent)
 {
     TabName = tabName;
 }
コード例 #4
0
 protected CraftingNode(CraftingNode parent)
 {
     Parent = parent;
 }