-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathCommonAsset.cpp
More file actions
31 lines (26 loc) · 1005 Bytes
/
Copy pathCommonAsset.cpp
File metadata and controls
31 lines (26 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "CommonAsset.h"
#include "IW3/CommonAssetIW3.h"
#include "IW4/CommonAssetIW4.h"
#include "IW5/CommonAssetIW5.h"
#include "QOS/CommonAssetQOS.h"
#include "T4/CommonAssetT4.h"
#include "T5/CommonAssetT5.h"
#include "T6/CommonAssetT6.h"
#include <cassert>
ICommonAssetTypeMapper* ICommonAssetTypeMapper::GetCommonAssetMapperByGame(GameId gameId)
{
static ICommonAssetTypeMapper* assetTypeMappers[]{
new IW3::CommonAssetTypeMapper(),
new IW4::CommonAssetTypeMapper(),
new IW5::CommonAssetTypeMapper(),
new QOS::CommonAssetTypeMapper(),
new T4::CommonAssetTypeMapper(),
new T5::CommonAssetTypeMapper(),
new T6::CommonAssetTypeMapper(),
};
static_assert(std::extent_v<decltype(assetTypeMappers)> == static_cast<unsigned>(GameId::COUNT));
assert(static_cast<unsigned>(gameId) < static_cast<unsigned>(GameId::COUNT));
auto* result = assetTypeMappers[static_cast<unsigned>(gameId)];
assert(result);
return result;
}