mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
(Entry.ChangeType): new public method.
This commit is contained in:
parent
a58c29625d
commit
ec9f615919
@ -53,6 +53,23 @@ namespace GameRes
|
||||
{
|
||||
return Offset < max_offset && Size <= max_offset && Offset <= max_offset - Size;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Change entry type to the type of resource <paramref name="res"/>.
|
||||
/// Entry name extension is changed accordingly.
|
||||
/// </summary>
|
||||
public void ChangeType (IResource res)
|
||||
{
|
||||
if (null == res)
|
||||
return;
|
||||
Type = res.Type;
|
||||
foreach (var ext in res.Extensions)
|
||||
{
|
||||
if (!string.IsNullOrEmpty (ext))
|
||||
Name = Path.ChangeExtension (Name, ext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PackedEntry : Entry
|
||||
|
Loading…
Reference in New Issue
Block a user