2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-01-11 19:21:50 +00:00

chore: add ObjCompiling component

This commit is contained in:
Jan
2024-10-20 14:12:16 +02:00
parent f9e0bdaa7b
commit 3803ae24f5
17 changed files with 227 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
#include "IObjCompiler.h"
#include "Game/IW3/ObjCompilerIW3.h"
#include "Game/IW4/ObjCompilerIW4.h"
#include "Game/IW5/ObjCompilerIW5.h"
#include "Game/T5/ObjCompilerT5.h"
#include "Game/T6/ObjCompilerT6.h"
#include <cassert>
const IObjCompiler* IObjCompiler::GetObjCompilerForGame(GameId game)
{
static const IObjCompiler* objCompilers[static_cast<unsigned>(GameId::COUNT)]{
new IW3::ObjCompiler(),
new IW4::ObjCompiler(),
new IW5::ObjCompiler(),
new T5::ObjCompiler(),
new T6::ObjCompiler(),
};
static_assert(std::extent_v<decltype(objCompilers)> == static_cast<unsigned>(GameId::COUNT));
assert(static_cast<unsigned>(game) < static_cast<unsigned>(GameId::COUNT));
const auto* result = objCompilers[static_cast<unsigned>(game)];
assert(result);
return result;
}