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/BsRTTIType.h"
7#include "Resources/BsResourceManifest.h"
8
9namespace bs
10{
11 /** @cond RTTI */
12 /** @addtogroup RTTI-Impl-Core
13 * @{
14 */
15
16 class BS_CORE_EXPORT ResourceManifestRTTI : public RTTIType<ResourceManifest, IReflectable, ResourceManifestRTTI>
17 {
18 private:
19 String& getName(ResourceManifest* obj) { return obj->mName; }
20 void setName(ResourceManifest* obj, String& val) { obj->mName = val; }
21
22 UnorderedMap<UUID, Path>& getUUIDMap(ResourceManifest* obj) { return obj->mUUIDToFilePath; }
23
24 void setUUIDMap(ResourceManifest* obj, UnorderedMap<UUID, Path>& val)
25 {
26 obj->mUUIDToFilePath = val;
27
28 obj->mFilePathToUUID.clear();
29
30 for(auto& entry : obj->mUUIDToFilePath)
31 {
32 obj->mFilePathToUUID[entry.second] = entry.first;
33 }
34 }
35 public:
36 ResourceManifestRTTI()
37 {
38 addPlainField("mName", 0, &ResourceManifestRTTI::getName, &ResourceManifestRTTI::setName);
39 addPlainField("mUUIDToFilePath", 1, &ResourceManifestRTTI::getUUIDMap, &ResourceManifestRTTI::setUUIDMap);
40 }
41
42 const String& getRTTIName() override
43 {
44 static String name = "ResourceManifest";
45 return name;
46 }
47
48 UINT32 getRTTIId() override
49 {
50 return TID_ResourceManifest;
51 }
52
53 SPtr<IReflectable> newRTTIObject() override
54 {
55 return ResourceManifest::createEmpty();
56 }
57 };
58
59 /** @} */
60 /** @endcond */
61}