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; } /// /// Natively tracks if the resource is currently in RAM/VRAM. /// public ResourceState State { get; internal set; } = ResourceState.Unloaded; /// /// Tracks how many entities or systems currently need this loaded. /// When it hits 0, the ResourceManager handles unloading natively. /// public int ReferenceCount { get; internal set; } = 0; internal abstract void Load(Stream stream); internal abstract void Unload(); }