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

ReadNodes() статический приватный Метод

static private ReadNodes ( BinaryReader reader ) : Node[]
reader System.IO.BinaryReader
Результат Node[]
        internal static Node[] ReadNodes(BinaryReader reader)
        {
            long length = reader.BaseStream.Length;
            if (length < 2)
                return null;

            ushort nodeCount = reader.ReadUInt16();

            if (nodeCount > 256 || nodeCount < 16 || length < 2 + nodeCount * 4)
                return null;

            Node[] nodes = new Node[nodeCount];
            for (int index = 0; index < nodeCount; index++)
                nodes[index] = new Node(reader);
            return nodes;
        }

Usage Example

Пример #1
0
        public override LoadMatchStrength LoadMatch(AssetLoader loader)
        {
            StringPackage.Node[] nodes = StringPackage.ReadNodes(loader.Reader);
            if (nodes == null || !nodes[nodes.Length - 1].CheckValidity(nodes.Length - 1, nodes))
            {
                return(LoadMatchStrength.None);
            }

            return(LoadMatchStrength.Medium);
        }