1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-06 09:15:33 +00:00
openmw/components/esm/esm3esm4bridge.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
735 B
C++
Raw Normal View History

2023-01-23 20:44:49 +00:00
#include <components/esm/esm3esm4bridge.hpp>
#include <components/esm3/loadcell.hpp>
#include <components/esm4/loadcell.hpp>
namespace ESM
{
const ESM::CellCommon* CellVariant::getCommon() const
{
if (isEsm4())
return &getEsm4();
else
return &getEsm3();
}
const ESM4::Cell& CellVariant::getEsm4() const
{
auto cell4 = std::get<0>(mVariant);
if (!cell4)
throw std::runtime_error("invalid variant acess");
return *cell4;
}
const ESM::Cell& CellVariant::getEsm3() const
{
auto cell = std::get<1>(mVariant);
if (!cell)
throw std::runtime_error("invalid variant acess");
return *cell;
}
}