ResourceManager.ResourceChecker.CheckInfo.RemoteVersionInfo.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 loyalsoft. All rights reserved.
  4. // Homepage: http://www.game7000.com/
  5. // Feedback: http://www.game7000.com/
  6. //------------------------------------------------------------
  7. using System.Runtime.InteropServices;
  8. namespace GameFramework.Resource
  9. {
  10. internal sealed partial class ResourceManager : GameFrameworkModule, IResourceManager
  11. {
  12. private sealed partial class ResourceChecker
  13. {
  14. private sealed partial class CheckInfo
  15. {
  16. /// <summary>
  17. /// 远程资源状态信息。
  18. /// </summary>
  19. [StructLayout(LayoutKind.Auto)]
  20. private struct RemoteVersionInfo
  21. {
  22. private readonly bool m_Exist;
  23. private readonly string m_FileSystemName;
  24. private readonly LoadType m_LoadType;
  25. private readonly int m_Length;
  26. private readonly int m_HashCode;
  27. private readonly int m_CompressedLength;
  28. private readonly int m_CompressedHashCode;
  29. public RemoteVersionInfo(string fileSystemName, LoadType loadType, int length, int hashCode, int compressedLength, int compressedHashCode)
  30. {
  31. m_Exist = true;
  32. m_FileSystemName = fileSystemName;
  33. m_LoadType = loadType;
  34. m_Length = length;
  35. m_HashCode = hashCode;
  36. m_CompressedLength = compressedLength;
  37. m_CompressedHashCode = compressedHashCode;
  38. }
  39. public bool Exist
  40. {
  41. get
  42. {
  43. return m_Exist;
  44. }
  45. }
  46. public bool UseFileSystem
  47. {
  48. get
  49. {
  50. return !string.IsNullOrEmpty(m_FileSystemName);
  51. }
  52. }
  53. public string FileSystemName
  54. {
  55. get
  56. {
  57. return m_FileSystemName;
  58. }
  59. }
  60. public LoadType LoadType
  61. {
  62. get
  63. {
  64. return m_LoadType;
  65. }
  66. }
  67. public int Length
  68. {
  69. get
  70. {
  71. return m_Length;
  72. }
  73. }
  74. public int HashCode
  75. {
  76. get
  77. {
  78. return m_HashCode;
  79. }
  80. }
  81. public int CompressedLength
  82. {
  83. get
  84. {
  85. return m_CompressedLength;
  86. }
  87. }
  88. public int CompressedHashCode
  89. {
  90. get
  91. {
  92. return m_CompressedHashCode;
  93. }
  94. }
  95. }
  96. }
  97. }
  98. }
  99. }