1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 19:45:34 +00:00
openmw/components/esm/esm3esm4bridge.hpp
florent.teppe 5037dcf9bc Fixes a crash on launch and some compile issue
also uses std::visit in cellstore comparison to avoid missing combinasion

split loadrefs in loadref of ESM4 and ESM3.
2023-01-27 16:41:00 +01:00

44 lines
806 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
{
protected:
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