| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// | 
|---|
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// | 
|---|
| 3 | #pragma once | 
|---|
| 4 |  | 
|---|
| 5 | #include "BsCorePrerequisites.h" | 
|---|
| 6 | #include "Reflection/BsIReflectable.h" | 
|---|
| 7 |  | 
|---|
| 8 | namespace bs | 
|---|
| 9 | { | 
|---|
| 10 | /** @addtogroup Resources-Internal | 
|---|
| 11 | *  @{ | 
|---|
| 12 | */ | 
|---|
| 13 |  | 
|---|
| 14 | /** | 
|---|
| 15 | * Contains information about a resource saved to the disk. | 
|---|
| 16 | * | 
|---|
| 17 | * @note Purpose of this class is primarily to be a wrapper around a list of objects to make serialization easier. | 
|---|
| 18 | */ | 
|---|
| 19 | class BS_CORE_EXPORT SavedResourceData : public IReflectable | 
|---|
| 20 | { | 
|---|
| 21 | public: | 
|---|
| 22 | SavedResourceData() = default; | 
|---|
| 23 | SavedResourceData(const Vector<UUID>& dependencies, bool allowAsync, UINT32 compressionMethod); | 
|---|
| 24 |  | 
|---|
| 25 | /**	Returns a list of all resource dependencies. */ | 
|---|
| 26 | const Vector<UUID>& getDependencies() const { return mDependencies; } | 
|---|
| 27 |  | 
|---|
| 28 | /**	Returns true if this resource is allow to be asynchronously loaded. */ | 
|---|
| 29 | bool allowAsyncLoading() const { return mAllowAsync; } | 
|---|
| 30 |  | 
|---|
| 31 | /** Returns the method used for compressing the resource. 0 if none. */ | 
|---|
| 32 | UINT32 getCompressionMethod() const { return mCompressionMethod; } | 
|---|
| 33 |  | 
|---|
| 34 | private: | 
|---|
| 35 | Vector<UUID> mDependencies; | 
|---|
| 36 | bool mAllowAsync = true; | 
|---|
| 37 | UINT32 mCompressionMethod = 0; | 
|---|
| 38 |  | 
|---|
| 39 | /************************************************************************/ | 
|---|
| 40 | /* 								SERIALIZATION                      		*/ | 
|---|
| 41 | /************************************************************************/ | 
|---|
| 42 | public: | 
|---|
| 43 | friend class SavedResourceDataRTTI; | 
|---|
| 44 | static RTTITypeBase* getRTTIStatic(); | 
|---|
| 45 | RTTITypeBase* getRTTI() const override; | 
|---|
| 46 | }; | 
|---|
| 47 |  | 
|---|
| 48 | /** @} */ | 
|---|
| 49 | } | 
|---|
| 50 |  | 
|---|