BsProjectResourceMeta.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsIReflectable.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Contains meta-data for a resource stored in the ProjectLibrary.
  8. */
  9. class ProjectResourceMeta : public IReflectable
  10. {
  11. private:
  12. struct ConstructPrivately {};
  13. public:
  14. explicit ProjectResourceMeta(const ConstructPrivately&);
  15. /**
  16. * @brief Creates a new project library resource meta-data entry.
  17. *
  18. * @param uuid UUID of the resource.
  19. * @param typeId RTTI type id of the resource.
  20. * @param resourceMetaData Non-project library specific meta-data.
  21. * @param importOptions Import options used for importing the resource.
  22. *
  23. * @return New project library resource meta data instance.
  24. */
  25. static ProjectResourceMetaPtr create(const String& uuid, UINT32 typeId, const ResourceMetaDataPtr& resourceMetaData,
  26. const ImportOptionsPtr& importOptions);
  27. /**
  28. * @brief Returns the UUID of the resource this meta data belongs to.
  29. */
  30. const String& getUUID() const { return mUUID; }
  31. /**
  32. * @brief Returns the non-project library specific meta-data,
  33. */
  34. ResourceMetaDataPtr getResourceMetaData() const { return mResourceMeta; }
  35. /**
  36. * @brief Returns the import options used for importing the resource this
  37. * object is referencing.
  38. */
  39. const ImportOptionsPtr& getImportOptions() const { return mImportOptions; }
  40. /**
  41. * @brief Returns the RTTI type ID of the resource this object is referencing.
  42. */
  43. UINT32 getTypeID() const { return mTypeId; }
  44. private:
  45. String mUUID;
  46. ResourceMetaDataPtr mResourceMeta;
  47. ImportOptionsPtr mImportOptions;
  48. UINT32 mTypeId;
  49. /************************************************************************/
  50. /* RTTI */
  51. /************************************************************************/
  52. /**
  53. * @brief Creates a new empty meta-data instance. Used only for serialization purposes.
  54. */
  55. static ProjectResourceMetaPtr createEmpty();
  56. public:
  57. friend class ProjectResourceMetaRTTI;
  58. static RTTITypeBase* getRTTIStatic();
  59. virtual RTTITypeBase* getRTTI() const override;
  60. };
  61. }