BsProjectResourceMeta.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "BsIReflectable.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Contains meta-data for a resource stored in the ProjectLibrary.
  10. */
  11. class ProjectResourceMeta : public IReflectable
  12. {
  13. private:
  14. struct ConstructPrivately {};
  15. public:
  16. explicit ProjectResourceMeta(const ConstructPrivately&);
  17. /**
  18. * @brief Creates a new project library resource meta-data entry.
  19. *
  20. * @param uuid UUID of the resource.
  21. * @param typeId RTTI type id of the resource.
  22. * @param resourceMetaData Non-project library specific meta-data.
  23. * @param importOptions Import options used for importing the resource.
  24. *
  25. * @return New project library resource meta data instance.
  26. */
  27. static ProjectResourceMetaPtr create(const String& uuid, UINT32 typeId, const ResourceMetaDataPtr& resourceMetaData,
  28. const ImportOptionsPtr& importOptions);
  29. /**
  30. * @brief Returns the UUID of the resource this meta data belongs to.
  31. */
  32. const String& getUUID() const { return mUUID; }
  33. /**
  34. * @brief Returns the non-project library specific meta-data,
  35. */
  36. ResourceMetaDataPtr getResourceMetaData() const { return mResourceMeta; }
  37. /**
  38. * @brief Returns the import options used for importing the resource this
  39. * object is referencing.
  40. */
  41. const ImportOptionsPtr& getImportOptions() const { return mImportOptions; }
  42. /**
  43. * @brief Returns the RTTI type ID of the resource this object is referencing.
  44. */
  45. UINT32 getTypeID() const { return mTypeId; }
  46. /**
  47. * @brief Checks should this resource always be included in the build, regardless if
  48. * it's being referenced or not.
  49. */
  50. bool getIncludeInBuild() const { return mIncludeInBuild; }
  51. /**
  52. * @brief Determines if this resource will always be included in the build, regardless if
  53. * it's being referenced or not.
  54. */
  55. void setIncludeInBuild(bool include) { mIncludeInBuild = include; }
  56. private:
  57. friend class ProjectLibrary;
  58. String mUUID;
  59. ResourceMetaDataPtr mResourceMeta;
  60. ImportOptionsPtr mImportOptions;
  61. UINT32 mTypeId;
  62. bool mIncludeInBuild;
  63. /************************************************************************/
  64. /* RTTI */
  65. /************************************************************************/
  66. /**
  67. * @brief Creates a new empty meta-data instance. Used only for serialization purposes.
  68. */
  69. static ProjectResourceMetaPtr createEmpty();
  70. public:
  71. friend class ProjectResourceMetaRTTI;
  72. static RTTITypeBase* getRTTIStatic();
  73. virtual RTTITypeBase* getRTTI() const override;
  74. };
  75. }