Exemplo n.º 1
0
        public IGameDataEntry GetEntryAtPath(string path)
        {
            // resolve the path, portion by portion
            var parts = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
            IGameDataDirectoryEntry entry = m_root;

            foreach (var part in parts)
            {
                if (part[0] == '.')
                {
                    continue;
                }

                var thisEntry = entry.GetEntry(part);

                if (thisEntry is IGameDataFileEntry file)
                {
                    return(file);
                }


                entry = (thisEntry as IGameDataDirectoryEntry);
            }

            return(entry);
        }
Exemplo n.º 2
0
 public static IGameDataDirectoryEntry GetDirectoryEntry(this IGameDataDirectoryEntry entry, string name) =>
 (entry.GetEntry(name) as IGameDataDirectoryEntry);