1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 06:39:41 +00:00
openmw/components/esm/esm3esm4bridge.hpp
2023-01-27 14:07:50 +01:00

44 lines
804 B
C++

#ifndef COMPONENTS_ESM_ESMBRIDGE
#define COMPONENTS_ESM_ESMBRIDGE
#include <string>
#include <string_view>
#include <variant>
#include <components/misc/notnullptr.hpp>
namespace ESM4
{
struct Cell;
}
namespace ESM
{
struct Cell;
struct CellId;
struct RefId;
struct CellVariant
{
private:
std::variant<const ESM4::Cell*, const ESM::Cell*> mVariant;
public:
explicit CellVariant(const ESM4::Cell& cell)
: mVariant(&cell)
{
}
explicit CellVariant(const ESM::Cell& cell)
: mVariant(&cell)
{
}
bool isEsm4() const { return std::holds_alternative<const ESM4::Cell*>(mVariant); }
const ESM4::Cell& getEsm4() const;
const ESM::Cell& getEsm3() const;
};
}
#endif