24 lines
517 B
C++
24 lines
517 B
C++
#pragma once
|
|
|
|
#include "RE/I/IFormFactory.h"
|
|
|
|
namespace RE
|
|
{
|
|
template <class T, ENUM_FORM_ID ID = T::FORM_ID>
|
|
class __declspec(novtable) ConcreteFormFactory :
|
|
public IFormFactory // 00
|
|
{
|
|
public:
|
|
[[nodiscard]] static ConcreteFormFactory* GetFormFactory()
|
|
{
|
|
const auto factories = GetFormFactories();
|
|
return static_cast<ConcreteFormFactory*>(factories[std::to_underlying(ID)]);
|
|
}
|
|
|
|
[[nodiscard]] T* Create() { return static_cast<T*>(DoCreate()); }
|
|
|
|
// members
|
|
const char* name{ nullptr };
|
|
};
|
|
}
|