v1.36.00
This commit is contained in:
46
AssetStudio/TypeFlags.cs
Normal file
46
AssetStudio/TypeFlags.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssetStudio;
|
||||
public static class TypeFlags
|
||||
{
|
||||
private static Dictionary<ClassIDType, (bool, bool)> Types;
|
||||
|
||||
public static void SetTypes(Dictionary<ClassIDType, (bool, bool)> types)
|
||||
{
|
||||
Types = types;
|
||||
}
|
||||
|
||||
public static void SetType(ClassIDType type, bool parse, bool export)
|
||||
{
|
||||
Types ??= new Dictionary<ClassIDType, (bool, bool)>();
|
||||
Types[type] = (parse, export);
|
||||
}
|
||||
|
||||
public static bool CanParse(this ClassIDType type)
|
||||
{
|
||||
if (Types == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (Types.TryGetValue(type, out var param))
|
||||
{
|
||||
return param.Item1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CanExport(this ClassIDType type)
|
||||
{
|
||||
if (Types == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (Types.TryGetValue(type, out var param))
|
||||
{
|
||||
return param.Item2;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user