mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
add method ArchiveManager.GetAllEntries()
This commit is contained in:
parent
63c27c28a9
commit
5786cf7868
3 changed files with 20 additions and 0 deletions
|
@ -11,6 +11,8 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
{
|
||||
public interface IArchive
|
||||
{
|
||||
IEnumerable<string> GetAllFiles();
|
||||
|
||||
IEnumerable<string> GetFileNamesWithExtension(string ext);
|
||||
|
||||
bool ContainsFile(string name);
|
||||
|
@ -65,6 +67,14 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
return _sLoadedArchives.Sum(a => a.NumLoadedEntries);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public static List<string> GetAllEntries()
|
||||
{
|
||||
return _sLoadedArchives
|
||||
.SelectMany(a => a.GetAllFiles())
|
||||
.ToList();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public static LooseArchive LoadLooseArchive(string dirPath)
|
||||
{
|
||||
|
|
|
@ -90,6 +90,11 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllFiles()
|
||||
{
|
||||
return _entries.Select(e => e.Name);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetFileNamesWithExtension(string ext)
|
||||
{
|
||||
return _extDict.ContainsKey(ext) ? _extDict[ext] : Enumerable.Empty<string>();
|
||||
|
|
|
@ -85,6 +85,11 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllFiles()
|
||||
{
|
||||
return _fileDict.Keys;
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetFileNamesWithExtension(string ext)
|
||||
{
|
||||
return _extDict.ContainsKey(ext) ? _extDict[ext] : Enumerable.Empty<string>();
|
||||
|
|
Loading…
Add table
Reference in a new issue