static List<VpkNode> LoadRootNodes(BinaryReader reader) { var nodes = new List<VpkNode>(); VpkNode newNode = null; while (newNode == null || !string.IsNullOrEmpty(newNode.Name)) { newNode = new VpkNode(); newNode.Load(reader); if (!string.IsNullOrEmpty(newNode.Name)) { nodes.Add(newNode); newNode.Children = LoadNodeChildren(reader, newNode); } } return nodes; }
static VpkNode[] LoadNodeChildren(BinaryReader reader, VpkNode parent) { var nodes = new List <VpkNode>(); VpkNode newNode = null; while (newNode == null || !string.IsNullOrEmpty(newNode.Name)) { newNode = new VpkNode(parent); newNode.Load(reader); if (!string.IsNullOrEmpty(newNode.Name)) { nodes.Add(newNode); newNode.Children = LoadNodeFileChildren(reader, newNode); } } return(nodes.ToArray()); }
static List <VpkNode> LoadRootNodes(BinaryReader reader) { var nodes = new List <VpkNode>(); VpkNode newNode = null; while (newNode == null || !string.IsNullOrEmpty(newNode.Name)) { newNode = new VpkNode(); newNode.Load(reader); if (!string.IsNullOrEmpty(newNode.Name)) { nodes.Add(newNode); newNode.Children = LoadNodeChildren(reader, newNode); } } return(nodes); }
static VpkNode[] LoadNodeChildren(BinaryReader reader, VpkNode parent) { var nodes = new List<VpkNode>(); VpkNode newNode = null; while (newNode == null || !string.IsNullOrEmpty(newNode.Name)) { newNode = new VpkNode(parent); newNode.Load(reader); if (!string.IsNullOrEmpty(newNode.Name)) { nodes.Add(newNode); newNode.Children = LoadNodeFileChildren(reader, newNode); } } return nodes.ToArray(); }