mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
use HasExtension method instead of string.EndsWith.
This commit is contained in:
@@ -63,7 +63,7 @@ namespace GameRes.Formats.BlackRainbow
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
{
|
||||
if (!file.Name.EndsWith (".ads", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (!file.Name.HasExtension (".ads"))
|
||||
return null;
|
||||
var arc_name = Path.GetFileNameWithoutExtension (file.Name);
|
||||
foreach (var key in KnownKeys.Values)
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace GameRes.Formats.BlackRainbow
|
||||
|
||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
||||
{
|
||||
if (!entry.Name.EndsWith (".hse", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (!entry.Name.HasExtension (".hse"))
|
||||
return base.OpenEntry (arc, entry);
|
||||
var data = arc.File.View.ReadBytes (entry.Offset, entry.Size);
|
||||
for (int i = 0; i < data.Length; ++i)
|
||||
@@ -114,7 +114,7 @@ namespace GameRes.Formats.BlackRainbow
|
||||
entry.Size = m_index.ReadUInt32();
|
||||
if (!entry.CheckPlacement (m_max_offset))
|
||||
return false;
|
||||
if (name.EndsWith (".hse", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (name.HasExtension (".hse"))
|
||||
entry.Type = "image";
|
||||
m_dir.Add (entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user