added missing consts to record save functions

pull/51/head
Marc Zinnschlag 11 years ago
parent db70095148
commit 874ce26bef

@ -44,9 +44,9 @@ namespace ESM
}
}
void AIPackageList::save(ESMWriter &esm)
void AIPackageList::save(ESMWriter &esm) const
{
typedef std::vector<AIPackage>::iterator PackageIter;
typedef std::vector<AIPackage>::const_iterator PackageIter;
for (PackageIter it = mList.begin(); it != mList.end(); ++it) {
switch (it->mType) {
case AI_Wander:

@ -93,7 +93,7 @@ namespace ESM
/// it needs to use retSubName() if needed. But, hey, there
/// is only one field left (XSCL) and only two records uses AI
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}

@ -3,7 +3,7 @@
#include "esmwriter.hpp"
void ESM::CellRef::save(ESMWriter &esm)
void ESM::CellRef::save(ESMWriter &esm) const
{
esm.writeHNT("FRMR", mRefnum);
esm.writeHNCString("NAME", mRefID);

@ -83,7 +83,7 @@ namespace ESM
// Position and rotation of this object within the cell
Position mPos;
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
};

@ -14,9 +14,9 @@ void EffectList::load(ESMReader &esm)
}
}
void EffectList::save(ESMWriter &esm)
void EffectList::save(ESMWriter &esm) const
{
for (std::vector<ENAMstruct>::iterator it = mList.begin(); it != mList.end(); ++it) {
for (std::vector<ENAMstruct>::const_iterator it = mList.begin(); it != mList.end(); ++it) {
esm.writeHNT<ENAMstruct>("ENAM", *it, 24);
}
}

@ -35,9 +35,9 @@ namespace ESM
std::vector<ENAMstruct> mList;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}
#endif

@ -10,7 +10,7 @@ void ESM::Filter::load (ESMReader& esm)
mDescription = esm.getHNString ("DESC");
}
void ESM::Filter::save (ESMWriter& esm)
void ESM::Filter::save (ESMWriter& esm) const
{
esm.writeHNCString ("FILT", mFilter);
esm.writeHNCString ("DESC", mDescription);

@ -17,7 +17,7 @@ namespace ESM
std::string mFilter;
void load (ESMReader& esm);
void save (ESMWriter& esm);
void save (ESMWriter& esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -11,7 +11,7 @@ void Activator::load(ESMReader &esm)
mName = esm.getHNString("FNAM");
mScript = esm.getHNOString("SCRI");
}
void Activator::save(ESMWriter &esm)
void Activator::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mName);

@ -14,7 +14,7 @@ struct Activator
std::string mId, mName, mScript, mModel;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -14,7 +14,7 @@ void Potion::load(ESMReader &esm)
esm.getHNT(mData, "ALDT", 12);
mEffects.load(esm);
}
void Potion::save(ESMWriter &esm)
void Potion::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("TEXT", mIcon);

@ -29,7 +29,7 @@ struct Potion
EffectList mEffects;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -28,7 +28,7 @@ void Apparatus::load(ESMReader &esm)
}
}
void Apparatus::save(ESMWriter &esm)
void Apparatus::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mName);

@ -35,7 +35,7 @@ struct Apparatus
std::string mId, mModel, mIcon, mScript, mName;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -18,9 +18,9 @@ void PartReferenceList::load(ESMReader &esm)
}
}
void PartReferenceList::save(ESMWriter &esm)
void PartReferenceList::save(ESMWriter &esm) const
{
for (std::vector<PartReference>::iterator it = mParts.begin(); it != mParts.end(); ++it)
for (std::vector<PartReference>::const_iterator it = mParts.begin(); it != mParts.end(); ++it)
{
esm.writeHNT("INDX", it->mPart);
esm.writeHNOString("BNAM", it->mMale);
@ -39,7 +39,7 @@ void Armor::load(ESMReader &esm)
mEnchant = esm.getHNOString("ENAM");
}
void Armor::save(ESMWriter &esm)
void Armor::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mName);

@ -56,7 +56,7 @@ struct PartReferenceList
std::vector<PartReference> mParts;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
struct Armor
@ -89,7 +89,7 @@ struct Armor
std::string mId, mName, mModel, mIcon, mScript, mEnchant;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -12,7 +12,7 @@ void BodyPart::load(ESMReader &esm)
mRace = esm.getHNString("FNAM");
esm.getHNT(mData, "BYDT", 4);
}
void BodyPart::save(ESMWriter &esm)
void BodyPart::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mRace);

@ -57,7 +57,7 @@ struct BodyPart
std::string mId, mModel, mRace;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}
#endif

@ -16,7 +16,7 @@ void Book::load(ESMReader &esm)
mText = esm.getHNOString("TEXT");
mEnchant = esm.getHNOString("ENAM");
}
void Book::save(ESMWriter &esm)
void Book::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);

@ -25,7 +25,7 @@ struct Book
std::string mId;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -15,7 +15,7 @@ void BirthSign::load(ESMReader &esm)
mPowers.load(esm);
}
void BirthSign::save(ESMWriter &esm)
void BirthSign::save(ESMWriter &esm) const
{
esm.writeHNCString("FNAM", mName);
esm.writeHNOCString("TNAM", mTexture);

@ -19,7 +19,7 @@ struct BirthSign
SpellList mPowers;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -89,7 +89,7 @@ void Cell::postLoad(ESMReader &esm)
esm.skipRecord();
}
void Cell::save(ESMWriter &esm)
void Cell::save(ESMWriter &esm) const
{
esm.writeHNT("DATA", mData, 12);
if (mData.mFlags & Interior)

@ -102,7 +102,7 @@ struct Cell
// This method is left in for compatibility with esmtool. Parsing moved references currently requires
// passing ESMStore, bit it does not know about this parameter, so we do it this way.
void load(ESMReader &esm, bool saveContext = true);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
bool isExterior() const
{

@ -47,7 +47,7 @@ void Class::load(ESMReader &esm)
mDescription = esm.getHNOString("DESC");
}
void Class::save(ESMWriter &esm)
void Class::save(ESMWriter &esm) const
{
esm.writeHNCString("FNAM", mName);
esm.writeHNT("CLDT", mData, 60);

@ -70,7 +70,7 @@ struct Class
CLDTstruct mData;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -20,7 +20,7 @@ void Clothing::load(ESMReader &esm)
mEnchant = esm.getHNOString("ENAM");
}
void Clothing::save(ESMWriter &esm)
void Clothing::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);

@ -45,7 +45,7 @@ struct Clothing
std::string mId, mName, mModel, mIcon, mEnchant, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -16,9 +16,9 @@ void InventoryList::load(ESMReader &esm)
}
}
void InventoryList::save(ESMWriter &esm)
void InventoryList::save(ESMWriter &esm) const
{
for (std::vector<ContItem>::iterator it = mList.begin(); it != mList.end(); ++it)
for (std::vector<ContItem>::const_iterator it = mList.begin(); it != mList.end(); ++it)
{
esm.writeHNT("NPCO", *it, 36);
}
@ -41,7 +41,7 @@ void Container::load(ESMReader &esm)
mInventory.load(esm);
}
void Container::save(ESMWriter &esm)
void Container::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);

@ -27,7 +27,7 @@ struct InventoryList
std::vector<ContItem> mList;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
struct Container
@ -46,7 +46,7 @@ struct Container
InventoryList mInventory;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -35,7 +35,7 @@ void Creature::load(ESMReader &esm)
esm.skipRecord();
}
void Creature::save(ESMWriter &esm)
void Creature::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("CNAM", mOriginal);

@ -86,7 +86,7 @@ struct Creature
AIPackageList mAiPackage;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -24,7 +24,7 @@ struct LoadCREC
esm.skipRecord();
}
void save(ESMWriter &esm)
void save(ESMWriter &esm) const
{
}
};
@ -39,7 +39,7 @@ struct LoadCNTC
esm.skipRecord();
}
void save(ESMWriter &esm)
void save(ESMWriter &esm) const
{
}
};

@ -25,7 +25,7 @@ void Dialogue::load(ESMReader &esm)
esm.fail("Unknown sub record size");
}
void Dialogue::save(ESMWriter &esm)
void Dialogue::save(ESMWriter &esm) const
{
if (mType != Deleted)
esm.writeHNT("DATA", mType);

@ -34,7 +34,7 @@ struct Dialogue
std::vector<DialInfo> mInfo;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}
#endif

@ -15,7 +15,7 @@ void Door::load(ESMReader &esm)
mCloseSound = esm.getHNOString("ANAM");
}
void Door::save(ESMWriter &esm)
void Door::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);

@ -14,7 +14,7 @@ struct Door
std::string mId, mName, mModel, mScript, mOpenSound, mCloseSound;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -12,7 +12,7 @@ void Enchantment::load(ESMReader &esm)
mEffects.load(esm);
}
void Enchantment::save(ESMWriter &esm)
void Enchantment::save(ESMWriter &esm) const
{
esm.writeHNT("ENDT", mData, 16);
mEffects.save(esm);

@ -39,7 +39,7 @@ struct Enchantment
EffectList mEffects;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}
#endif

@ -47,7 +47,7 @@ void Faction::load(ESMReader &esm)
mReactions.push_back(r);
}
}
void Faction::save(ESMWriter &esm)
void Faction::save(ESMWriter &esm) const
{
esm.writeHNCString("FNAM", mName);
@ -61,7 +61,7 @@ void Faction::save(ESMWriter &esm)
esm.writeHNT("FADT", mData, 240);
for (std::vector<Reaction>::iterator it = mReactions.begin(); it != mReactions.end(); ++it)
for (std::vector<Reaction>::const_iterator it = mReactions.begin(); it != mReactions.end(); ++it)
{
esm.writeHNString("ANAM", it->mFaction);
esm.writeHNT("INTV", it->mReaction);

@ -63,7 +63,7 @@ struct Faction
std::string mRanks[10];
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -7,7 +7,7 @@ namespace ESM
mValue.read (esm, ESM::Variant::Format_Global);
}
void Global::save (ESMWriter &esm)
void Global::save (ESMWriter &esm) const
{
mValue.write (esm, ESM::Variant::Format_Global);
}

@ -21,7 +21,7 @@ struct Global
Variant mValue;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -7,7 +7,7 @@ namespace ESM
mValue.read (esm, ESM::Variant::Format_Gmst);
}
void GameSetting::save (ESMWriter &esm)
void GameSetting::save (ESMWriter &esm) const
{
mValue.write (esm, ESM::Variant::Format_Gmst);
}

@ -24,7 +24,7 @@ struct GameSetting
void load(ESMReader &esm);
/// \todo remove the get* functions (redundant, since mValue as equivalent functions now).
/// \todo remove the get* functions (redundant, since mValue has equivalent functions now).
int getInt() const;
///< Throws an exception if GMST is not of type int or float.
@ -35,7 +35,7 @@ struct GameSetting
std::string getString() const;
///< Throwns an exception if GMST is not of type string.
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -120,7 +120,7 @@ void DialInfo::load(ESMReader &esm)
esm.skipRecord();
}
void DialInfo::save(ESMWriter &esm)
void DialInfo::save(ESMWriter &esm) const
{
esm.writeHNCString("INAM", mId);
esm.writeHNCString("PNAM", mPrev);
@ -135,7 +135,7 @@ void DialInfo::save(ESMWriter &esm)
esm.writeHNOCString("SNAM", mSound);
esm.writeHNOString("NAME", mResponse);
for (std::vector<SelectStruct>::iterator it = mSelects.begin(); it != mSelects.end(); ++it)
for (std::vector<SelectStruct>::const_iterator it = mSelects.begin(); it != mSelects.end(); ++it)
{
esm.writeHNString("SCVR", it->mSelectRule);
it->mValue.write (esm, Variant::Format_Info);

@ -99,7 +99,7 @@ struct DialInfo
};
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}

@ -37,7 +37,7 @@ void Ingredient::load(ESMReader &esm)
}
}
void Ingredient::save(ESMWriter &esm)
void Ingredient::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mName);

@ -28,7 +28,7 @@ struct Ingredient
std::string mId, mName, mModel, mIcon, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -16,14 +16,14 @@ void Land::LandData::save(ESMWriter &esm)
offsets.mHeightOffset = mHeights[0] / HEIGHT_SCALE;
offsets.mUnk1 = mUnk1;
offsets.mUnk2 = mUnk2;
float prevY = mHeights[0], prevX;
int number = 0; // avoid multiplication
for (int i = 0; i < LAND_SIZE; ++i) {
float diff = (mHeights[number] - prevY) / HEIGHT_SCALE;
offsets.mHeightData[number] =
(diff >= 0) ? (int8_t) (diff + 0.5) : (int8_t) (diff - 0.5);
prevX = prevY = mHeights[number];
++number;
@ -132,7 +132,7 @@ void Land::load(ESMReader &esm)
mLandData = NULL;
}
void Land::save(ESMWriter &esm)
void Land::save(ESMWriter &esm) const
{
esm.startSubRecord("INTV");
esm.writeT(mX);
@ -140,18 +140,6 @@ void Land::save(ESMWriter &esm)
esm.endRecord("INTV");
esm.writeHNT("DATA", mFlags);
// TODO: Land!
bool wasLoaded = mDataLoaded;
if (mDataTypes) {
// Try to load all available data before saving
loadData(mDataTypes);
}
if (mDataLoaded)
mLandData->save(esm);
if (!wasLoaded)
unloadData(); // Don't need to keep the data loaded if it wasn't already
}
/// \todo remove memory allocation when only defaults needed

@ -94,7 +94,7 @@ struct Land
LandData *mLandData;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
/**
* Actually loads data

@ -33,13 +33,13 @@ void LeveledListBase::load(ESMReader &esm)
esm.getHNT(li.mLevel, "INTV");
}
}
void LeveledListBase::save(ESMWriter &esm)
void LeveledListBase::save(ESMWriter &esm) const
{
esm.writeHNT("DATA", mFlags);
esm.writeHNT("NNAM", mChanceNone);
esm.writeHNT<int>("INDX", mList.size());
for (std::vector<LevelItem>::iterator it = mList.begin(); it != mList.end(); ++it)
for (std::vector<LevelItem>::const_iterator it = mList.begin(); it != mList.end(); ++it)
{
esm.writeHNCString(mRecName, it->mId);
esm.writeHNT("INTV", it->mLevel);

@ -51,7 +51,7 @@ struct LeveledListBase
std::vector<LevelItem> mList;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -16,7 +16,7 @@ void Light::load(ESMReader &esm)
mScript = esm.getHNOString("SCRI");
mSound = esm.getHNOString("SNAM");
}
void Light::save(ESMWriter &esm)
void Light::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);

@ -44,7 +44,7 @@ struct Light
std::string mSound, mScript, mModel, mIcon, mName, mId;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -17,7 +17,7 @@ void Lockpick::load(ESMReader &esm)
mIcon = esm.getHNOString("ITEX");
}
void Lockpick::save(ESMWriter &esm)
void Lockpick::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mName);

@ -24,7 +24,7 @@ struct Lockpick
std::string mId, mName, mModel, mIcon, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -11,7 +11,7 @@ void LandTexture::load(ESMReader &esm)
esm.getHNT(mIndex, "INTV");
mTexture = esm.getHNString("DATA");
}
void LandTexture::save(ESMWriter &esm)
void LandTexture::save(ESMWriter &esm) const
{
esm.writeHNT("INTV", mIndex);
esm.writeHNCString("DATA", mTexture);

@ -31,7 +31,7 @@ struct LandTexture
int mIndex;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}
#endif

@ -58,15 +58,11 @@ void MagicEffect::load(ESMReader &esm)
mDescription = esm.getHNOString("DESC");
}
void MagicEffect::save(ESMWriter &esm)
void MagicEffect::save(ESMWriter &esm) const
{
esm.writeHNT("INDX", mIndex);
mData.mFlags &= 0xe00;
esm.writeHNT("MEDT", mData, 36);
if (mIndex>=0 && mIndex<NumberOfHardcodedFlags) {
mData.mFlags |= HardcodedFlags[mIndex];
}
esm.writeHNOCString("ITEX", mIcon);
esm.writeHNOCString("PTEX", mParticle);
@ -74,12 +70,12 @@ void MagicEffect::save(ESMWriter &esm)
esm.writeHNOCString("CSND", mCastSound);
esm.writeHNOCString("HSND", mHitSound);
esm.writeHNOCString("ASND", mAreaSound);
esm.writeHNOCString("CVFX", mCasting);
esm.writeHNOCString("BVFX", mBolt);
esm.writeHNOCString("HVFX", mHit);
esm.writeHNOCString("AVFX", mArea);
esm.writeHNOString("DESC", mDescription);
}

@ -69,7 +69,7 @@ struct MagicEffect
int mIndex;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
enum Effects

@ -14,7 +14,7 @@ void Miscellaneous::load(ESMReader &esm)
mScript = esm.getHNOString("SCRI");
mIcon = esm.getHNOString("ITEX");
}
void Miscellaneous::save(ESMWriter &esm)
void Miscellaneous::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);

@ -29,7 +29,7 @@ struct Miscellaneous
std::string mId, mName, mModel, mIcon, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -63,7 +63,7 @@ void NPC::load(ESMReader &esm)
mAiPackage.load(esm);
esm.skipRecord();
}
void NPC::save(ESMWriter &esm)
void NPC::save(ESMWriter &esm) const
{
esm.writeHNOCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);
@ -87,7 +87,7 @@ void NPC::save(ESMWriter &esm)
esm.writeHNT("AIDT", mAiData, sizeof(mAiData));
}
typedef std::vector<Dest>::iterator DestIter;
typedef std::vector<Dest>::const_iterator DestIter;
for (DestIter it = mTransport.begin(); it != mTransport.end(); ++it) {
esm.writeHNT("DODT", it->mPos, sizeof(it->mPos));
esm.writeHNOCString("DNAM", it->mCellName);

@ -117,7 +117,7 @@ struct NPC
std::string mHair, mHead;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
bool isMale() const;

@ -84,7 +84,7 @@ struct LoadNPCC
{
esm.skipRecord();
}
void save(ESMWriter &esm)
void save(ESMWriter &esm) const
{
}
};

@ -70,25 +70,25 @@ void Pathgrid::load(ESMReader &esm)
}
}
}
void Pathgrid::save(ESMWriter &esm)
void Pathgrid::save(ESMWriter &esm) const
{
esm.writeHNT("DATA", mData, 12);
esm.writeHNCString("NAME", mCell);
if (!mPoints.empty())
{
esm.startSubRecord("PGRP");
for (PointList::iterator it = mPoints.begin(); it != mPoints.end(); ++it)
for (PointList::const_iterator it = mPoints.begin(); it != mPoints.end(); ++it)
{
esm.writeT(*it);
}
esm.endRecord("PGRP");
}
if (!mEdges.empty())
{
esm.startSubRecord("PGRC");
for (std::vector<Edge>::iterator it = mEdges.begin(); it != mEdges.end(); ++it)
for (std::vector<Edge>::const_iterator it = mEdges.begin(); it != mEdges.end(); ++it)
{
esm.writeT(it->mV1);
}

@ -46,7 +46,7 @@ struct Pathgrid
EdgeList mEdges;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}
#endif

@ -17,7 +17,7 @@ void Probe::load(ESMReader &esm)
mIcon = esm.getHNOString("ITEX");
}
void Probe::save(ESMWriter &esm)
void Probe::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mName);

@ -24,7 +24,7 @@ struct Probe
std::string mId, mName, mModel, mIcon, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -22,7 +22,7 @@ void Race::load(ESMReader &esm)
mPowers.load(esm);
mDescription = esm.getHNOString("DESC");
}
void Race::save(ESMWriter &esm)
void Race::save(ESMWriter &esm) const
{
esm.writeHNCString("FNAM", mName);
esm.writeHNT("RADT", mData, 140);

@ -65,7 +65,7 @@ struct Race
SpellList mPowers;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -28,7 +28,7 @@ void Region::load(ESMReader &esm)
mSoundList.push_back(sr);
}
}
void Region::save(ESMWriter &esm)
void Region::save(ESMWriter &esm) const
{
esm.writeHNCString("FNAM", mName);
@ -40,7 +40,7 @@ void Region::save(ESMWriter &esm)
esm.writeHNOCString("BNAM", mSleepList);
esm.writeHNT("CNAM", mMapColor);
for (std::vector<SoundRef>::iterator it = mSoundList.begin(); it != mSoundList.end(); ++it)
for (std::vector<SoundRef>::const_iterator it = mSoundList.begin(); it != mSoundList.end(); ++it)
{
esm.writeHNT<SoundRef>("SNAM", *it);
}

@ -47,7 +47,7 @@ struct Region
std::vector<SoundRef> mSoundList;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -17,7 +17,7 @@ void Repair::load(ESMReader &esm)
mIcon = esm.getHNOString("ITEX");
}
void Repair::save(ESMWriter &esm)
void Repair::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNCString("FNAM", mName);

@ -24,7 +24,7 @@ struct Repair
std::string mId, mName, mModel, mIcon, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -50,11 +50,11 @@ void Script::load(ESMReader &esm)
// Script text
mScriptText = esm.getHNOString("SCTX");
}
void Script::save(ESMWriter &esm)
void Script::save(ESMWriter &esm) const
{
std::string varNameString;
if (!mVarNames.empty())
for (std::vector<std::string>::iterator it = mVarNames.begin(); it != mVarNames.end(); ++it)
for (std::vector<std::string>::const_iterator it = mVarNames.begin(); it != mVarNames.end(); ++it)
varNameString.append(*it);
SCHD data;
@ -68,7 +68,7 @@ void Script::save(ESMWriter &esm)
if (!mVarNames.empty())
{
esm.startSubRecord("SCVR");
for (std::vector<std::string>::iterator it = mVarNames.begin(); it != mVarNames.end(); ++it)
for (std::vector<std::string>::const_iterator it = mVarNames.begin(); it != mVarNames.end(); ++it)
{
esm.writeHCString(*it);
}

@ -56,7 +56,7 @@ public:
std::string mScriptText; // Uncompiled script
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -137,7 +137,7 @@ void Skill::load(ESMReader &esm)
mId = indexToId (mIndex);
}
void Skill::save(ESMWriter &esm)
void Skill::save(ESMWriter &esm) const
{
esm.writeHNT("INDX", mIndex);
esm.writeHNT("SKDT", mData, 24);

@ -75,7 +75,7 @@ struct Skill
static const boost::array<SkillEnum, Length> sSkillIds;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -13,7 +13,7 @@ void SoundGenerator::load(ESMReader &esm)
mCreature = esm.getHNOString("CNAM");
mSound = esm.getHNOString("SNAM");
}
void SoundGenerator::save(ESMWriter &esm)
void SoundGenerator::save(ESMWriter &esm) const
{
esm.writeHNT("DATA", mType, 4);
esm.writeHNOCString("CNAM", mCreature);

@ -33,7 +33,7 @@ struct SoundGenerator
std::string mId, mCreature, mSound;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}
#endif

@ -17,7 +17,7 @@ void Sound::load(ESMReader &esm)
<< endl;
*/
}
void Sound::save(ESMWriter &esm)
void Sound::save(ESMWriter &esm) const
{
esm.writeHNCString("FNAM", mSound);
esm.writeHNT("DATA", mData, 3);

@ -20,7 +20,7 @@ struct Sound
std::string mId, mSound;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -13,7 +13,7 @@ void Spell::load(ESMReader &esm)
mEffects.load(esm);
}
void Spell::save(ESMWriter &esm)
void Spell::save(ESMWriter &esm) const
{
esm.writeHNOCString("FNAM", mName);
esm.writeHNT("SPDT", mData, 12);

@ -42,7 +42,7 @@ struct Spell
EffectList mEffects;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).

@ -11,7 +11,7 @@ void StartScript::load(ESMReader &esm)
mData = esm.getHNString("DATA");
mScript = esm.getHNString("NAME");
}
void StartScript::save(ESMWriter &esm)
void StartScript::save(ESMWriter &esm) const
{
esm.writeHNString("DATA", mData);
esm.writeHNString("NAME", mScript);

@ -24,7 +24,7 @@ struct StartScript
// Load a record and add it to the list
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}

@ -10,7 +10,7 @@ void Static::load(ESMReader &esm)
{
mModel = esm.getHNString("MODL");
}
void Static::save(ESMWriter &esm)
void Static::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
}

@ -25,7 +25,7 @@ struct Static
std::string mId, mModel;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -15,7 +15,7 @@ void Weapon::load(ESMReader &esm)
mIcon = esm.getHNOString("ITEX");
mEnchant = esm.getHNOString("ENAM");
}
void Weapon::save(ESMWriter &esm)
void Weapon::save(ESMWriter &esm) const
{
esm.writeHNCString("MODL", mModel);
esm.writeHNOCString("FNAM", mName);

@ -59,7 +59,7 @@ struct Weapon
std::string mId, mName, mModel, mIcon, mEnchant, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID).

@ -12,9 +12,9 @@ void SpellList::load(ESMReader &esm)
}
}
void SpellList::save(ESMWriter &esm)
void SpellList::save(ESMWriter &esm) const
{
for (std::vector<std::string>::iterator it = mList.begin(); it != mList.end(); ++it) {
for (std::vector<std::string>::const_iterator it = mList.begin(); it != mList.end(); ++it) {
esm.writeHNString("NPCS", *it, 32);
}
}

@ -17,7 +17,7 @@ namespace ESM
std::vector<std::string> mList;
void load(ESMReader &esm);
void save(ESMWriter &esm);
void save(ESMWriter &esm) const;
};
}

Loading…
Cancel
Save