resource stuff

This commit is contained in:
max
2026-04-28 19:17:23 +02:00
parent fec2cd8d24
commit 059638e6e0
9 changed files with 386 additions and 45 deletions
+22
View File
@@ -1,8 +1,30 @@
using System;
namespace Nerfed.Runtime;
public enum ResourceState
{
Unloaded,
Queued,
Loading,
Loaded,
Failed
}
public abstract class Resource
{
public Guid Id { get; internal set; }
public string Path { get; internal set; }
/// <summary>
/// Natively tracks if the resource is currently in RAM/VRAM.
/// </summary>
public ResourceState State { get; internal set; } = ResourceState.Unloaded;
/// <summary>
/// Tracks how many entities or systems currently need this loaded.
/// When it hits 0, the ResourceManager handles unloading natively.
/// </summary>
public int ReferenceCount { get; internal set; } = 0;
internal abstract void Load(Stream stream);
internal abstract void Unload();