1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-19 12:40:49 +00:00

Make the sRedcordId constexpr

This commit is contained in:
jvoisin 2022-06-04 16:07:59 +02:00
parent 33c66e3d5e
commit 6c71071083
88 changed files with 147 additions and 163 deletions

View File

@ -2,13 +2,10 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int DebugProfile::sRecordId = REC_DBGP;
void DebugProfile::load (ESMReader& esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
class ESMReader;
@ -10,7 +12,8 @@ namespace ESM
struct DebugProfile
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_DBGP;
enum Flags
{

View File

@ -2,13 +2,10 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Filter::sRecordId = REC_FILT;
void Filter::load (ESMReader& esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -2,6 +2,7 @@
#define COMPONENTS_ESM_FILTER_H
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -10,7 +11,8 @@ namespace ESM
struct Filter
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_FILT;
unsigned int mRecordFlags;
std::string mId;

View File

@ -2,13 +2,10 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int GlobalMap::sRecordId = REC_GMAP;
void GlobalMap::load (ESMReader &esm)
{
esm.getHNT(mBounds, "BNDS");

View File

@ -4,6 +4,8 @@
#include <vector>
#include <set>
#include "components/esm/defs.hpp"
namespace ESM
{
class ESMReader;
@ -14,7 +16,8 @@ namespace ESM
///< \brief An image containing the explored areas on the global map.
struct GlobalMap
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_GMAP;
// The minimum and maximum cell coordinates
struct Bounds

View File

@ -6,8 +6,6 @@
namespace ESM
{
unsigned int Activator::sRecordId = REC_ACTI;
void Activator::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -2,6 +2,7 @@
#define OPENMW_ESM_ACTI_H
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -11,7 +12,8 @@ class ESMWriter;
struct Activator
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_ACTI;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Activator"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Potion::sRecordId = REC_ALCH;
void Potion::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string>
#include "effectlist.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -17,7 +18,8 @@ class ESMWriter;
struct Potion
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_ALCH;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Potion"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Apparatus::sRecordId = REC_APPA;
void Apparatus::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -15,7 +17,8 @@ class ESMWriter;
struct Apparatus
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_APPA;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Apparatus"; }

View File

@ -36,8 +36,6 @@ namespace ESM
}
}
unsigned int Armor::sRecordId = REC_ARMO;
void Armor::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -4,6 +4,8 @@
#include <vector>
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -65,7 +67,8 @@ struct PartReferenceList
struct Armor
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_ARMO;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Armor"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int BodyPart::sRecordId = REC_BODY;
void BodyPart::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -2,6 +2,7 @@
#define OPENMW_ESM_BODY_H
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -11,7 +12,8 @@ class ESMWriter;
struct BodyPart
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_BODY;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "BodyPart"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Book::sRecordId = REC_BOOK;
void Book::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -2,6 +2,7 @@
#define OPENMW_ESM_BOOK_H
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -14,7 +15,8 @@ class ESMWriter;
struct Book
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_BOOK;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Book"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int BirthSign::sRecordId = REC_BSGN;
void BirthSign::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string>
#include "spelllist.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -13,7 +14,8 @@ class ESMWriter;
struct BirthSign
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_BSGN;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "BirthSign"; }

View File

@ -9,7 +9,6 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
#include "cellid.hpp"
namespace ESM
@ -41,8 +40,6 @@ namespace
namespace ESM
{
unsigned int Cell::sRecordId = REC_CELL;
// Some overloaded compare operators.
bool operator== (const MovedCellRef& ref, const RefNum& refNum)
{

View File

@ -63,7 +63,8 @@ struct CellRefTrackerPredicate
*/
struct Cell
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_CELL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Cell"; }

View File

@ -8,8 +8,6 @@
namespace ESM
{
unsigned int Class::sRecordId = REC_CLAS;
const Class::Specialization Class::sSpecializationIds[3] = {
Class::Combat,
Class::Magic,

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -17,7 +19,8 @@ class ESMWriter;
// class
struct Class
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_CLAS;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Class"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Clothing::sRecordId = REC_CLOT;
void Clothing::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string>
#include "loadarmo.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -17,7 +18,8 @@ class ESMWriter;
struct Clothing
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_CLOT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Clothing"; }

View File

@ -27,8 +27,6 @@ namespace ESM
}
}
unsigned int Container::sRecordId = REC_CONT;
void Container::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -5,6 +5,7 @@
#include <vector>
#include "components/esm/esmcommon.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -35,7 +36,8 @@ struct InventoryList
struct Container
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_CONT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Container"; }

View File

@ -4,13 +4,10 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Creature::sRecordId = REC_CREA;
void Creature::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -8,6 +8,8 @@
#include "aipackage.hpp"
#include "transport.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -21,7 +23,8 @@ class ESMWriter;
struct Creature
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_CREA;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Creature"; }

View File

@ -4,11 +4,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Dialogue::sRecordId = REC_DIAL;
void Dialogue::load(ESMReader &esm, bool &isDeleted)
{

View File

@ -5,6 +5,7 @@
#include <list>
#include <map>
#include "components/esm/defs.hpp"
#include "loadinfo.hpp"
namespace ESM
@ -20,7 +21,7 @@ class ESMWriter;
struct Dialogue
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_DIAL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Dialogue"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Door::sRecordId = REC_DOOR;
void Door::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -11,7 +13,8 @@ class ESMWriter;
struct Door
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_DOOR;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Door"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Enchantment::sRecordId = REC_ENCH;
void Enchantment::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,7 @@
#include <string>
#include "components/esm/defs.hpp"
#include "effectlist.hpp"
namespace ESM
@ -17,7 +18,8 @@ class ESMWriter;
struct Enchantment
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_ENCH;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Enchantment"; }

View File

@ -4,12 +4,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Faction::sRecordId = REC_FACT;
int& Faction::FADTstruct::getSkill (int index, bool ignored)
{
if (index<0 || index>=7)

View File

@ -4,6 +4,8 @@
#include <string>
#include <map>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -30,7 +32,8 @@ struct RankData
struct Faction
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_FACT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Faction"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Global::sRecordId = REC_GLOB;
void Global::load (ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -5,6 +5,8 @@
#include "variant.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -17,7 +19,8 @@ class ESMWriter;
struct Global
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_GLOB;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Global"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int GameSetting::sRecordId = REC_GMST;
void GameSetting::load (ESMReader &esm, bool &isDeleted)
{
isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future)

View File

@ -5,6 +5,8 @@
#include "variant.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -18,7 +20,8 @@ class ESMWriter;
struct GameSetting
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_GMST;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "GameSetting"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int DialInfo::sRecordId = REC_INFO;
void DialInfo::load(ESMReader &esm, bool &isDeleted)
{
mId = esm.getHNString("INAM");

View File

@ -20,7 +20,8 @@ class ESMWriter;
struct DialInfo
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_INFO;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "DialInfo"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Ingredient::sRecordId = REC_INGR;
void Ingredient::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -15,7 +17,8 @@ class ESMWriter;
struct Ingredient
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_INGR;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Ingredient"; }

View File

@ -9,8 +9,6 @@
namespace ESM
{
unsigned int Land::sRecordId = REC_LAND;
Land::Land()
: mFlags(0)
, mX(0)

View File

@ -5,6 +5,7 @@
#include <components/misc/constants.hpp>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp"
namespace ESM
@ -19,7 +20,8 @@ class ESMWriter;
struct Land
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_LAND;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Land"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Light::sRecordId = REC_LIGH;
void Light::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -16,7 +18,8 @@ class ESMWriter;
struct Light
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_LIGH;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Light"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Lockpick::sRecordId = REC_LOCK;
void Lockpick::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -11,7 +13,8 @@ class ESMWriter;
struct Lockpick
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_LOCK;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Lockpick"; }

View File

@ -6,8 +6,6 @@
namespace ESM
{
unsigned int LandTexture::sRecordId = REC_LTEX;
void LandTexture::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -18,7 +20,8 @@ class ESMWriter;
struct LandTexture
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_LTEX;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "LandTexture"; }

View File

@ -187,8 +187,6 @@ namespace
namespace ESM
{
unsigned int MagicEffect::sRecordId = REC_MGEF;
void MagicEffect::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false; // MagicEffect record can't be deleted now (may be changed in the future)

View File

@ -5,6 +5,8 @@
#include <string_view>
#include <map>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -13,7 +15,8 @@ class ESMWriter;
struct MagicEffect
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_MGEF;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "MagicEffect"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Miscellaneous::sRecordId = REC_MISC;
void Miscellaneous::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -16,7 +18,8 @@ class ESMWriter;
struct Miscellaneous
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_MISC;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Miscellaneous"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int NPC::sRecordId = REC_NPC_;
void NPC::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -23,7 +23,8 @@ class ESMWriter;
struct NPC
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_NPC_;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "NPC"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Pathgrid::sRecordId = REC_PGRD;
Pathgrid::Point& Pathgrid::Point::operator=(const float rhs[3])
{
mX = static_cast<int>(rhs[0]);

View File

@ -4,6 +4,8 @@
#include <string>
#include <vector>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -15,7 +17,8 @@ class ESMWriter;
*/
struct Pathgrid
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_PGRD;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Pathgrid"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Probe::sRecordId = REC_PROB;
void Probe::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -11,7 +13,8 @@ class ESMWriter;
struct Probe
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_PROB;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Probe"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Race::sRecordId = REC_RACE;
int Race::MaleFemale::getValue (bool male) const
{
return male ? mMale : mFemale;

View File

@ -4,6 +4,7 @@
#include <string>
#include "spelllist.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -17,7 +18,8 @@ class ESMWriter;
struct Race
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_RACE;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Race"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Region::sRecordId = REC_REGN;
void Region::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string>
#include <vector>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp"
namespace ESM
@ -18,7 +19,8 @@ class ESMWriter;
struct Region
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_REGN;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Region"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Repair::sRecordId = REC_REPA;
void Repair::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -11,7 +13,8 @@ class ESMWriter;
struct Repair
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_REPA;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Repair"; }

View File

@ -6,12 +6,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Script::sRecordId = REC_SCPT;
void Script::loadSCVR(ESMReader &esm)
{
int s = mData.mStringTableSize;

View File

@ -4,6 +4,7 @@
#include <string>
#include <vector>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp"
namespace ESM
@ -19,7 +20,8 @@ class ESMWriter;
class Script
{
public:
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SCPT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Script"; }

View File

@ -125,8 +125,6 @@ namespace ESM
HandToHand
}};
unsigned int Skill::sRecordId = REC_SKIL;
void Skill::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false; // Skill record can't be deleted now (may be changed in the future)

View File

@ -19,7 +19,8 @@ class ESMWriter;
struct Skill
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SKIL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Skill"; }

View File

@ -6,8 +6,6 @@
namespace ESM
{
unsigned int SoundGenerator::sRecordId = REC_SNDG;
void SoundGenerator::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -15,7 +17,8 @@ class ESMWriter;
struct SoundGenerator
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SNDG;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "SoundGenerator"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Sound::sRecordId = REC_SOUN;
void Sound::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -16,7 +18,8 @@ struct SOUNstruct
struct Sound
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SOUN;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Sound"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Spell::sRecordId = REC_SPEL;
void Spell::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string>
#include "effectlist.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
@ -13,7 +14,8 @@ class ESMWriter;
struct Spell
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SPEL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Spell"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int StartScript::sRecordId = REC_SSCR;
void StartScript::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -19,7 +21,8 @@ class ESMWriter;
struct StartScript
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SSCR;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "StartScript"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM
{
unsigned int Static::sRecordId = REC_STAT;
void Static::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string>
#include "components/esm/defs.hpp"
namespace ESM
{
@ -23,7 +25,8 @@ class ESMWriter;
struct Static
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_STAT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Static"; }

View File

@ -6,8 +6,6 @@
namespace ESM
{
unsigned int Weapon::sRecordId = REC_WEAP;
void Weapon::load(ESMReader &esm, bool &isDeleted)
{
isDeleted = false;

View File

@ -17,7 +17,8 @@ class ESMWriter;
struct Weapon
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_WEAP;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Weapon"; }

View File

@ -6,7 +6,6 @@
namespace ESM
{
unsigned int SavedGame::sRecordId = REC_SAVE;
int SavedGame::sCurrentFormat = 21;
void SavedGame::load (ESMReader &esm)

View File

@ -15,7 +15,7 @@ namespace ESM
struct SavedGame
{
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SAVE;
static int sCurrentFormat;