ResourceManager.ReadWriteResourceInfo.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. [StructLayout(LayoutKind.Auto)]
  13. private struct ReadWriteResourceInfo
  14. {
  15. private readonly string m_FileSystemName;
  16. private readonly LoadType m_LoadType;
  17. private readonly int m_Length;
  18. private readonly int m_HashCode;
  19. public ReadWriteResourceInfo(string fileSystemName, LoadType loadType, int length, int hashCode)
  20. {
  21. m_FileSystemName = fileSystemName;
  22. m_LoadType = loadType;
  23. m_Length = length;
  24. m_HashCode = hashCode;
  25. }
  26. public bool UseFileSystem
  27. {
  28. get
  29. {
  30. return !string.IsNullOrEmpty(m_FileSystemName);
  31. }
  32. }
  33. public string FileSystemName
  34. {
  35. get
  36. {
  37. return m_FileSystemName;
  38. }
  39. }
  40. public LoadType LoadType
  41. {
  42. get
  43. {
  44. return m_LoadType;
  45. }
  46. }
  47. public int Length
  48. {
  49. get
  50. {
  51. return m_Length;
  52. }
  53. }
  54. public int HashCode
  55. {
  56. get
  57. {
  58. return m_HashCode;
  59. }
  60. }
  61. }
  62. }
  63. }