BsProjectResourceMeta.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. String mUUID;
  56. ResourceMetaDataPtr mResourceMeta;
  57. ImportOptionsPtr mImportOptions;
  58. UINT32 mTypeId;
  59. bool mIncludeInBuild;
  60. /************************************************************************/
  61. /* RTTI */
  62. /************************************************************************/
  63. /**
  64. * @brief Creates a new empty meta-data instance. Used only for serialization purposes.
  65. */
  66. static ProjectResourceMetaPtr createEmpty();
  67. public:
  68. friend class ProjectResourceMetaRTTI;
  69. static RTTITypeBase* getRTTIStatic();
  70. virtual RTTITypeBase* getRTTI() const override;
  71. };
  72. }