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
7namespace LkEngine {
8
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
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}
Definition AssetImporter.h:10
Definition ObjectPtr.h:102
Definition Asset.h:11
Definition AssetImporter.h:24
Definition Asset.h:92