mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-28 03:40:04 +00:00
Convert RefId to class
This commit is contained in:
parent
8a6a3c7121
commit
996153f78d
@ -13,7 +13,7 @@ class QVariant;
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CSMWorld
|
namespace CSMWorld
|
||||||
|
@ -17,7 +17,7 @@ namespace ESM
|
|||||||
{
|
{
|
||||||
class ESMReader;
|
class ESMReader;
|
||||||
class ESMWriter;
|
class ESMWriter;
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
|
@ -21,7 +21,7 @@ namespace osg
|
|||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct Class;
|
struct Class;
|
||||||
struct RefId;
|
class RefId;
|
||||||
class ESMReader;
|
class ESMReader;
|
||||||
class ESMWriter;
|
class ESMWriter;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace Interpreter
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Compiler
|
namespace Compiler
|
||||||
|
@ -16,7 +16,7 @@ namespace MWWorld
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWSound
|
namespace MWSound
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Loading
|
namespace Loading
|
||||||
|
@ -57,7 +57,7 @@ namespace ESM
|
|||||||
struct CreatureLevList;
|
struct CreatureLevList;
|
||||||
struct ItemLevList;
|
struct ItemLevList;
|
||||||
struct TimeStamp;
|
struct TimeStamp;
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWPhysics
|
namespace MWPhysics
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
|
@ -9,7 +9,7 @@ namespace ESM
|
|||||||
{
|
{
|
||||||
struct DialInfo;
|
struct DialInfo;
|
||||||
struct Dialogue;
|
struct Dialogue;
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWDialogue
|
namespace MWDialogue
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
|
@ -12,7 +12,7 @@ namespace ESM
|
|||||||
{
|
{
|
||||||
class Script;
|
class Script;
|
||||||
struct Locals;
|
struct Locals;
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
|
@ -45,7 +45,7 @@ namespace SceneUtil
|
|||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct Position;
|
struct Position;
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Files
|
namespace Files
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Compiler
|
namespace Compiler
|
||||||
|
@ -16,7 +16,7 @@ namespace ESM
|
|||||||
{
|
{
|
||||||
struct Cell;
|
struct Cell;
|
||||||
struct Pathgrid;
|
struct Pathgrid;
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Loading
|
namespace Loading
|
||||||
|
@ -16,7 +16,7 @@ namespace ESM
|
|||||||
{
|
{
|
||||||
struct Cell;
|
struct Cell;
|
||||||
struct CellId;
|
struct CellId;
|
||||||
struct RefId;
|
class RefId;
|
||||||
|
|
||||||
class CellVariant
|
class CellVariant
|
||||||
{
|
{
|
||||||
|
@ -13,8 +13,9 @@ namespace ESM
|
|||||||
// RefId is used to represent an Id that identifies an ESM record. These Ids can then be used in
|
// RefId is used to represent an Id that identifies an ESM record. These Ids can then be used in
|
||||||
// ESM::Stores to find the actual record. These Ids can be serialized/de-serialized, stored on disk and remain
|
// ESM::Stores to find the actual record. These Ids can be serialized/de-serialized, stored on disk and remain
|
||||||
// valid. They are used by ESM files, by records to reference other ESM records.
|
// valid. They are used by ESM files, by records to reference other ESM records.
|
||||||
struct RefId
|
class RefId
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
const static RefId sEmpty;
|
const static RefId sEmpty;
|
||||||
|
|
||||||
bool empty() const { return mId.empty(); }
|
bool empty() const { return mId.empty(); }
|
||||||
@ -32,17 +33,16 @@ namespace ESM
|
|||||||
static RefId formIdRefId(const ESM4::FormId id);
|
static RefId formIdRefId(const ESM4::FormId id);
|
||||||
const std::string& getRefIdString() const { return mId; }
|
const std::string& getRefIdString() const { return mId; }
|
||||||
|
|
||||||
private:
|
|
||||||
std::string mId;
|
|
||||||
|
|
||||||
bool operator==(std::string_view rhs) const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
template <std::size_t size>
|
template <std::size_t size>
|
||||||
bool operator==(const char (&rhs)[size]) const
|
bool operator==(const char (&rhs)[size]) const
|
||||||
{
|
{
|
||||||
return *this == std::string_view(rhs);
|
return *this == std::string_view(rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string mId;
|
||||||
|
|
||||||
|
bool operator==(std::string_view rhs) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ namespace ESM
|
|||||||
{
|
{
|
||||||
class ESMReader;
|
class ESMReader;
|
||||||
class ESMWriter;
|
class ESMWriter;
|
||||||
struct RefId;
|
class RefId;
|
||||||
|
|
||||||
// NOTE: spell ids must be lower case
|
// NOTE: spell ids must be lower case
|
||||||
struct SpellState
|
struct SpellState
|
||||||
|
@ -16,7 +16,7 @@ namespace ESM
|
|||||||
struct Land;
|
struct Land;
|
||||||
struct Static;
|
struct Static;
|
||||||
class Variant;
|
class Variant;
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace EsmLoader
|
namespace EsmLoader
|
||||||
|
@ -11,7 +11,7 @@ namespace VFS
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
struct RefId;
|
class RefId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Misc
|
namespace Misc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user