2024-11-12 23:57:46 +00:00
|
|
|
namespace LyraApi.Asset;
|
|
|
|
|
|
|
|
public class Handle<T>(UntypedHandle handle) where T : IAssetHandle
|
|
|
|
{
|
|
|
|
internal UntypedHandle inner = handle;
|
|
|
|
|
2024-11-14 00:11:26 +00:00
|
|
|
public bool Watched { get => inner.Watched; }
|
2024-11-12 23:57:46 +00:00
|
|
|
public ulong Version { get => inner.Version; }
|
|
|
|
public Guid Uuid { get => inner.Uuid; }
|
2024-11-14 00:11:26 +00:00
|
|
|
public string? Path { get => inner.Path; }
|
2024-11-12 23:57:46 +00:00
|
|
|
public bool IsLoaded { get => inner.IsLoaded; }
|
|
|
|
|
|
|
|
public void WaitForLoad()
|
|
|
|
{
|
|
|
|
inner.WaitForLoad();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void WaitForLoadRecursive()
|
|
|
|
{
|
|
|
|
inner.WaitForLoadRecursive();
|
|
|
|
}
|
|
|
|
|
|
|
|
public T? GetData()
|
|
|
|
{
|
|
|
|
if (IsLoaded)
|
|
|
|
{
|
|
|
|
return (T?)T.FromRawHandle(inner);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return default;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|