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
7
namespace
Grindstone::Reflection {
8
struct
TypeDescriptor_AssetReference
:
TypeDescriptor
{
9
std::string name;
10
AssetType assetType;
11
12
template
<
typename
ItemType>
13
TypeDescriptor_AssetReference
(ItemType* itemType)
14
:
TypeDescriptor
{
15
"AssetReference<>"
,
16
sizeof
(
Grindstone::GenericAssetReference
),
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
}
Grindstone::AssetReference
Definition
Asset.hpp:44
Grindstone::GenericAssetReference
Definition
Asset.hpp:39
Grindstone::Reflection::TypeDescriptor_AssetReference
Definition
TypeDescriptorAsset.hpp:8
Grindstone::Reflection::TypeDescriptor
Definition
TypeDescriptor.hpp:6
Grindstone::Reflection::TypeResolver
Definition
TypeResolver.hpp:8
sources
code
EngineCore
Reflection
TypeDescriptorAsset.hpp
Generated by
1.12.0