BsSavedResourceData.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsIReflectable.h"
  6. namespace bs
  7. {
  8. /** @addtogroup Resources-Internal
  9. * @{
  10. */
  11. /**
  12. * Contains information about a resource saved to the disk.
  13. *
  14. * @note Purpose of this class is primarily to be a wrapper around a list of objects to make serialization easier.
  15. */
  16. class BS_CORE_EXPORT SavedResourceData : public IReflectable
  17. {
  18. public:
  19. SavedResourceData();
  20. SavedResourceData(const Vector<String>& dependencies, bool allowAsync, UINT32 compressionMethod);
  21. /** Returns a list of all resource dependencies. */
  22. const Vector<String>& getDependencies() const { return mDependencies; }
  23. /** Returns true if this resource is allow to be asynchronously loaded. */
  24. bool allowAsyncLoading() const { return mAllowAsync; }
  25. /** Returns the method used for compressing the resource. 0 if none. */
  26. UINT32 getCompressionMethod() const { return mCompressionMethod; }
  27. private:
  28. Vector<String> mDependencies;
  29. bool mAllowAsync;
  30. UINT32 mCompressionMethod;
  31. /************************************************************************/
  32. /* SERIALIZATION */
  33. /************************************************************************/
  34. public:
  35. friend class SavedResourceDataRTTI;
  36. static RTTITypeBase* getRTTIStatic();
  37. RTTITypeBase* getRTTI() const override;
  38. };
  39. /** @} */
  40. }