Alexandria.Engines.UltimaUnderworld.StringPackage.Node.CheckValidity C# (CSharp) Метод

CheckValidity() публичный Метод

public CheckValidity ( int index, Node nodes ) : bool
index int
nodes Node
Результат bool
            public bool CheckValidity(int index, Node[] nodes)
            {
                if (Checked)
                    return false;
                Checked = true;
                return (Parent != 255 || index == nodes.Length - 1) && // Only the root node has no parent.
                    (Parent > index) && // No self-parenting, parents come from later nodes.
                    ((Left != 0xFF && Right != 0xFF) || (Left == 0xFF && Right == 0xFF)) && // Both branches must be 0xFF if one is.
                    (Left == 0xFF || (Left < index && nodes[Left].CheckValidity(Left, nodes))) && // Left branch if present is earlier and is also valid.
                    (Right == 0xFF || (Right < index && nodes[Right].CheckValidity(Right, nodes))) // Right branch if present is earlier and is also valid.
                    ;
            }
StringPackage.Node