mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 17:47:24 +02:00
* Add deterministic disposal for textures in IResourceCache * Review * Thanks PJB Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com> * Review --------- Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
63 lines
1.9 KiB
C#
63 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using Robust.Client.Audio;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Shared.ContentPack;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.Client.ResourceManagement;
|
|
|
|
/// <summary>
|
|
/// Handles caching of <see cref="BaseResource"/>
|
|
/// </summary>
|
|
[NotContentImplementable]
|
|
public interface IResourceCache : IResourceManager
|
|
{
|
|
T GetResource<T>(string path, bool useFallback = true)
|
|
where T : BaseResource, new();
|
|
|
|
T GetResource<T>(ResPath path, bool useFallback = true)
|
|
where T : BaseResource, new();
|
|
|
|
bool TryGetResource<T>(string path, [NotNullWhen(true)] out T? resource)
|
|
where T : BaseResource, new();
|
|
|
|
bool TryGetResource<T>(ResPath path, [NotNullWhen(true)] out T? resource)
|
|
where T : BaseResource, new();
|
|
|
|
bool TryGetResource(AudioStream stream, [NotNullWhen(true)] out AudioResource? resource);
|
|
|
|
bool TryRemoveResource<T>(string path) where T : BaseResource, IBaseResource, new();
|
|
|
|
bool TryRemoveResource<T>(ResPath path) where T : BaseResource, IBaseResource, new();
|
|
|
|
void ReloadResource<T>(string path)
|
|
where T : BaseResource, new();
|
|
|
|
void ReloadResource<T>(ResPath path)
|
|
where T : BaseResource, new();
|
|
|
|
void CacheResource<T>(string path, T resource)
|
|
where T : BaseResource, new();
|
|
|
|
void CacheResource<T>(ResPath path, T resource)
|
|
where T : BaseResource, new();
|
|
|
|
T GetFallback<T>()
|
|
where T : BaseResource, new();
|
|
|
|
IEnumerable<KeyValuePair<ResPath, T>> GetAllResources<T>() where T : BaseResource, new();
|
|
|
|
// Resource load callbacks so content can hook stuff like click maps.
|
|
event Action<TextureLoadedEventArgs> OnRawTextureLoaded;
|
|
event Action<RsiLoadedEventArgs> OnRsiLoaded;
|
|
|
|
[Obsolete("Fetch these through IoC directly instead")]
|
|
IClyde Clyde { get; }
|
|
|
|
[Obsolete("Fetch these through IoC directly instead")]
|
|
IFontManager FontManager { get; }
|
|
}
|
|
|