Files
Pal3.Unity/Assets/Scripts/Engine/Services/ITextureCache.cs
Jiaqi (0x7c13) Liu e870cf487a Add core protocol regression tests and copyright checks
Cover SCE command contracts, binary readers, resource layouts and full local CPK decompression for PAL3 and PAL3A. Fix CVD time rebasing, binary read bounds and short reads, and CPK/NAV validation.

Standardize first-party copyright headers, preserve correct creation years, and update console source generation. Validate both variants in Unity and verify all live CPK entries.
2026-11-12 13:37:27 +08:00

36 lines
1.5 KiB
C#

// ------------------------------------------------------------------------
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
// See LICENSE file in the project root for license information.
// ------------------------------------------------------------------------
namespace Engine.Services
{
using Core.Abstraction;
/// <summary>
/// Interface for a texture cache that stores and retrieves textures by a string key.
/// </summary>
public interface ITextureCache
{
/// <summary>
/// Adds a texture to the cache with the specified key.
/// </summary>
/// <param name="key">The key to associate with the texture.</param>
/// <param name="texture">The texture to add to the cache.</param>
/// <param name="hasAlphaChannel">Whether the texture has an alpha channel.</param>
public void Add(string key, ITexture2D texture, bool hasAlphaChannel);
/// <summary>
/// Attempts to retrieve a texture from the cache with the specified key.
/// </summary>
/// <param name="key">The key associated with the texture.</param>
/// <param name="texture">The retrieved texture, if found.</param>
/// <returns>True if the texture was found in the cache, false otherwise.</returns>
public bool TryGet(string key, out (ITexture2D texture, bool hasAlphaChannel) texture);
/// <summary>
/// Disposes all textures in the cache.
/// </summary>
public void DisposeAll();
}
}