mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
22 lines
488 B
C#
22 lines
488 B
C#
using System.Text.Json;
|
|
|
|
namespace AssetRipper.GUI.Electron;
|
|
|
|
public readonly record struct CollectionPath(BundlePath BundlePath, int Index)
|
|
{
|
|
public AssetPath GetAsset(long pathID)
|
|
{
|
|
return new(this, pathID);
|
|
}
|
|
|
|
public string ToJson()
|
|
{
|
|
return JsonSerializer.Serialize(this, PathSerializerContext.Default.CollectionPath);
|
|
}
|
|
|
|
public static CollectionPath FromJson(string json)
|
|
{
|
|
return JsonSerializer.Deserialize(json, PathSerializerContext.Default.CollectionPath);
|
|
}
|
|
}
|