//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 loyalsoft. All rights reserved. // Homepage: http://www.game7000.com/ // Feedback: http://www.game7000.com/ //------------------------------------------------------------ using System.Runtime.InteropServices; namespace GameFramework.Resource { internal sealed partial class ResourceManager : GameFrameworkModule, IResourceManager { private sealed partial class ResourceUpdater { /// /// 资源应用信息。 /// [StructLayout(LayoutKind.Auto)] private struct ApplyInfo { private readonly ResourceName m_ResourceName; private readonly string m_FileSystemName; private readonly LoadType m_LoadType; private readonly long m_Offset; private readonly int m_Length; private readonly int m_HashCode; private readonly int m_CompressedLength; private readonly int m_CompressedHashCode; private readonly string m_ResourcePath; /// /// 初始化资源应用信息的新实例。 /// /// 资源名称。 /// 资源所在的文件系统名称。 /// 资源加载方式。 /// 资源偏移。 /// 资源大小。 /// 资源哈希值。 /// 压缩后大小。 /// 压缩后哈希值。 /// 资源路径。 public ApplyInfo(ResourceName resourceName, string fileSystemName, LoadType loadType, long offset, int length, int hashCode, int compressedLength, int compressedHashCode, string resourcePath) { m_ResourceName = resourceName; m_FileSystemName = fileSystemName; m_LoadType = loadType; m_Offset = offset; m_Length = length; m_HashCode = hashCode; m_CompressedLength = compressedLength; m_CompressedHashCode = compressedHashCode; m_ResourcePath = resourcePath; } /// /// 获取资源名称。 /// public ResourceName ResourceName { get { return m_ResourceName; } } /// /// 获取资源是否使用文件系统。 /// public bool UseFileSystem { get { return !string.IsNullOrEmpty(m_FileSystemName); } } /// /// 获取资源所在的文件系统名称。 /// public string FileSystemName { get { return m_FileSystemName; } } /// /// 获取资源加载方式。 /// public LoadType LoadType { get { return m_LoadType; } } /// /// 获取资源偏移。 /// public long Offset { get { return m_Offset; } } /// /// 获取资源大小。 /// public int Length { get { return m_Length; } } /// /// 获取资源哈希值。 /// public int HashCode { get { return m_HashCode; } } /// /// 获取压缩后大小。 /// public int CompressedLength { get { return m_CompressedLength; } } /// /// 获取压缩后哈希值。 /// public int CompressedHashCode { get { return m_CompressedHashCode; } } /// /// 获取资源路径。 /// public string ResourcePath { get { return m_ResourcePath; } } } } } }