2023-01-23 22:51:45 +00:00
|
|
|
#ifndef COMPONENTS_ESM_ESMBRIDGE
|
|
|
|
#define COMPONENTS_ESM_ESMBRIDGE
|
2023-01-22 22:40:55 +00:00
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
|
|
|
#include <variant>
|
|
|
|
|
2023-01-23 18:08:52 +00:00
|
|
|
#include <components/misc/notnullptr.hpp>
|
|
|
|
|
2023-01-22 22:40:55 +00:00
|
|
|
namespace ESM4
|
|
|
|
{
|
|
|
|
struct Cell;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct Cell;
|
|
|
|
struct CellId;
|
|
|
|
struct RefId;
|
|
|
|
|
|
|
|
struct CellVariant
|
|
|
|
{
|
2023-01-23 18:08:52 +00:00
|
|
|
std::variant<const ESM4::Cell*, const ESM::Cell*, const void*> mVariant;
|
|
|
|
|
|
|
|
CellVariant()
|
|
|
|
: mVariant((void*)(nullptr))
|
|
|
|
{
|
|
|
|
}
|
2023-01-22 22:40:55 +00:00
|
|
|
|
|
|
|
explicit CellVariant(const ESM4::Cell* cell)
|
|
|
|
: mVariant(cell)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit CellVariant(const ESM::Cell* cell)
|
|
|
|
: mVariant(cell)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-01-23 18:08:52 +00:00
|
|
|
bool isValid() const
|
2023-01-22 22:40:55 +00:00
|
|
|
{
|
2023-01-23 18:08:52 +00:00
|
|
|
return std::holds_alternative<const ESM4::Cell*>(mVariant)
|
|
|
|
|| std::holds_alternative<const ESM::Cell*>(mVariant);
|
2023-01-22 22:40:55 +00:00
|
|
|
}
|
|
|
|
|
2023-01-23 18:08:52 +00:00
|
|
|
bool isEsm4() const { return std::holds_alternative<const ESM4::Cell*>(mVariant); }
|
|
|
|
|
|
|
|
const ESM4::Cell& getEsm4() const;
|
|
|
|
|
|
|
|
const ESM::Cell& getEsm3() const;
|
2023-01-22 22:40:55 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|