mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-17 00:46:34 +00:00
Common attribute are in one structure that has two constructors, one for ESM3 vs ESM4 Cell Mood part of MWWorld::Cell
22 lines
567 B
C++
22 lines
567 B
C++
#include <components/esm/esm3esm4bridge.hpp>
|
|
#include <components/esm3/loadcell.hpp>
|
|
#include <components/esm4/loadcell.hpp>
|
|
|
|
namespace ESM
|
|
{
|
|
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;
|
|
}
|
|
}
|