mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
provide some statistics from loaded archives
This commit is contained in:
parent
119dbb2db7
commit
20461c854b
3 changed files with 19 additions and 0 deletions
|
@ -16,6 +16,8 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
bool ContainsFile(string name);
|
||||
|
||||
Stream ReadFile(string name);
|
||||
|
||||
int NumLoadedEntries { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -51,6 +53,18 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
|
||||
private static readonly List<IArchive> _sLoadedArchives = new List<IArchive>();
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public static int GetNumArchives()
|
||||
{
|
||||
return _sLoadedArchives.Count;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public static int GetTotalNumLoadedEntries()
|
||||
{
|
||||
return _sLoadedArchives.Sum(a => a.NumLoadedEntries);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public static LooseArchive LoadLooseArchive(string dirPath)
|
||||
{
|
||||
|
|
|
@ -39,6 +39,8 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
public readonly String Version;
|
||||
public readonly UInt32 EntryCount;
|
||||
|
||||
public int NumLoadedEntries => _entries.Count;
|
||||
|
||||
private ImageArchive(Stream stream)
|
||||
{
|
||||
_stream = stream;
|
||||
|
|
|
@ -39,6 +39,9 @@ namespace SanAndreasUnity.Importing.Archive
|
|||
private readonly Dictionary<String, LooseArchiveEntry> _fileDict;
|
||||
private readonly Dictionary<String, List<String>> _extDict;
|
||||
|
||||
public int NumLoadedEntries => _fileDict.Count;
|
||||
|
||||
|
||||
public static LooseArchive Load(string dirPath)
|
||||
{
|
||||
return new LooseArchive(dirPath);
|
||||
|
|
Loading…
Add table
Reference in a new issue