using Godot;
// ReSharper disable once CheckNamespace
namespace GodotResourceGroups;
///
/// A background loader for resource groups. Use or
/// to create an instance of this class.
///
public class ResourceGroupBackgroundLoader
{
private readonly GodotObject _wrapped;
internal ResourceGroupBackgroundLoader(GodotObject wrapped)
{
_wrapped = wrapped;
}
///
/// Cancels the background loading. The callback will not be called anymore after this method returns.
///
public void Cancel()
{
_wrapped.Call("cancel");
}
///
/// Returns true if the background loading is done. Will also return true if the loading was cancelled.
///
public bool IsDone()
{
return _wrapped.Call("is_done").As();
}
public readonly struct ResourceLoadingInfo
{
private readonly GodotObject _wrapped;
public ResourceLoadingInfo(GodotObject wrapped)
{
_wrapped = wrapped;
}
public bool Success => _wrapped.Get("success").As();
public string Path => _wrapped.Get("path").As();
public Resource Resource => _wrapped.Get("resource").As();
public float Progress => _wrapped.Get("progress").As();
public bool Last => _wrapped.Get("last").As();
}
}