Exemplo n.º 1
0
        /// <summary>
        /// Reads an archive from the path provided.
        /// </summary>
        /// <param name="path">The path to read from.</param>
        /// <returns>The archive, if it can be read.</returns>
        public static Optional <IArchive> ReadFile(string path)
        {
            if (path.EndsWith(".wad", StringComparison.OrdinalIgnoreCase))
            {
                return(Wad.FromArchive(path));
            }

            // Note that by not searching for PK3 only, we indirectly support
            // reading anything that is a zip archive.
            return(PK3.FromArchive(path));
        }