Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
TypeDescriptorAsset.hpp
1#pragma once
2
3#include "TypeDescriptor.hpp"
4#include "TypeResolver.hpp"
5#include "EngineCore/Assets/Asset.hpp"
6
7namespace Grindstone::Reflection {
9 std::string name;
10 AssetType assetType;
11
12 template <typename ItemType>
13 TypeDescriptor_AssetReference(ItemType* itemType)
15 "AssetReference<>",
17 ReflectionTypeData::AssetReference
18 },
19 assetType(ItemType::GetStaticType()),
20 name((std::string("AssetReference<") + ItemType::GetStaticTypeName() + ">").c_str())
21 {}
22
23 virtual const char* GetFullName() const override {
24 return name.c_str();
25 }
26 };
27
28 template <typename T>
29 class TypeResolver<Grindstone::AssetReference<T>> {
30 public:
31 static TypeDescriptor* Get() {
32 static TypeDescriptor_AssetReference typeDesc{ (T*) nullptr };
33 return &typeDesc;
34 }
35 };
36}
Definition Asset.hpp:44
Definition Asset.hpp:39
Definition TypeDescriptorAsset.hpp:8
Definition TypeDescriptor.hpp:6
Definition TypeResolver.hpp:8