BsProjectResourceMeta.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. /**
  45. * @brief Checks should this resource always be included in the build, regardless if
  46. * it's being referenced or not.
  47. */
  48. bool getIncludeInBuild() const { return mIncludeInBuild; }
  49. /**
  50. * @brief Determines if this resource will always be included in the build, regardless if
  51. * it's being referenced or not.
  52. */
  53. void setIncludeInBuild(bool include) { mIncludeInBuild = include; }
  54. private:
  55. friend class ProjectLibrary;
  56. String mUUID;
  57. ResourceMetaDataPtr mResourceMeta;
  58. ImportOptionsPtr mImportOptions;
  59. UINT32 mTypeId;
  60. bool mIncludeInBuild;
  61. /************************************************************************/
  62. /* RTTI */
  63. /************************************************************************/
  64. /**
  65. * @brief Creates a new empty meta-data instance. Used only for serialization purposes.
  66. */
  67. static ProjectResourceMetaPtr createEmpty();
  68. public:
  69. friend class ProjectResourceMetaRTTI;
  70. static RTTITypeBase* getRTTIStatic();
  71. virtual RTTITypeBase* getRTTI() const override;
  72. };
  73. }