mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 19:45:34 +00:00
5037dcf9bc
also uses std::visit in cellstore comparison to avoid missing combinasion split loadrefs in loadref of ESM4 and ESM3.
44 lines
806 B
C++
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
|