LkEngine
0.1.2
Loading...
Searching...
No Matches
AssetImporter.h
1
#pragma once
2
3
#include "LkEngine/Asset/Asset.h"
4
#include "LkEngine/Asset/AssetRegistry.h"
5
#include "LkEngine/Asset/AssetSerializer.h"
6
7
namespace
LkEngine
{
8
9
class
LAssetImporter
10
{
11
public
:
12
static
void
Initialize();
13
static
void
Serialize(
const
FAssetMetadata
& Metadata,
const
TObjectPtr<LAsset>
& Asset);
14
static
void
Serialize(
const
TObjectPtr<LAsset>
& Asset);
15
static
bool
TryLoadData(
const
FAssetMetadata
& Metadata,
TObjectPtr<LAsset>
& Asset);
16
17
private
:
18
static
std::unordered_map<EAssetType, std::unique_ptr<IAssetSerializer>> SerializerMap;
19
20
friend
struct
FAssetImporterValidator
;
21
};
22
23
struct
FAssetImporterValidator
24
{
25
static
void
ValidateSerializer(
const
FAssetMetadata
& Metadata)
26
{
27
if
(!LAssetImporter::SerializerMap.contains(Metadata.Type))
28
{
29
LK_CORE_ASSERT(
false
,
"No asset importer exists for: {}"
, Enum::ToString(Metadata.Type));
30
}
31
}
32
};
33
34
}
LkEngine::LAssetImporter
Definition
AssetImporter.h:10
LkEngine::TObjectPtr
Definition
ObjectPtr.h:102
LkEngine
Definition
Asset.h:11
LkEngine::FAssetImporterValidator
Definition
AssetImporter.h:24
LkEngine::FAssetMetadata
Definition
Asset.h:92
LkEngine
Source
LkEngine
Asset
AssetImporter.h
Generated by
1.12.0