|
|
|
@ -45,8 +45,8 @@ namespace CSMWorld
|
|
|
|
|
|
|
|
|
|
virtual RecordBase& getRecord (int index)= 0;
|
|
|
|
|
|
|
|
|
|
virtual void appendRecord (const std::string& id) = 0;
|
|
|
|
|
|
|
|
|
|
virtual void appendRecord (const std::string& id, bool base) = 0;
|
|
|
|
|
|
|
|
|
|
virtual void insertRecord (RecordBase& record) = 0;
|
|
|
|
|
|
|
|
|
|
virtual void load (int index, ESM::ESMReader& reader, bool base) = 0;
|
|
|
|
@ -69,8 +69,8 @@ namespace CSMWorld
|
|
|
|
|
|
|
|
|
|
virtual RecordBase& getRecord (int index);
|
|
|
|
|
|
|
|
|
|
virtual void appendRecord (const std::string& id);
|
|
|
|
|
|
|
|
|
|
virtual void appendRecord (const std::string& id, bool base);
|
|
|
|
|
|
|
|
|
|
virtual void insertRecord (RecordBase& record);
|
|
|
|
|
|
|
|
|
|
virtual void load (int index, ESM::ESMReader& reader, bool base);
|
|
|
|
@ -88,7 +88,7 @@ namespace CSMWorld
|
|
|
|
|
Record<RecordT>& newRecord = dynamic_cast<Record<RecordT>& >(record);
|
|
|
|
|
mContainer.push_back(newRecord);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename RecordT>
|
|
|
|
|
int RefIdDataContainer<RecordT>::getSize() const
|
|
|
|
|
{
|
|
|
|
@ -108,12 +108,15 @@ namespace CSMWorld
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename RecordT>
|
|
|
|
|
void RefIdDataContainer<RecordT>::appendRecord (const std::string& id)
|
|
|
|
|
void RefIdDataContainer<RecordT>::appendRecord (const std::string& id, bool base)
|
|
|
|
|
{
|
|
|
|
|
Record<RecordT> record;
|
|
|
|
|
|
|
|
|
|
record.mState = base ? RecordBase::State_BaseOnly : RecordBase::State_ModifiedOnly;
|
|
|
|
|
|
|
|
|
|
record.mBase.mId = id;
|
|
|
|
|
record.mModified.mId = id;
|
|
|
|
|
record.mModified.blank();
|
|
|
|
|
record.mState = RecordBase::State_ModifiedOnly;
|
|
|
|
|
(base ? record.mBase : record.mModified).blank();
|
|
|
|
|
|
|
|
|
|
mContainer.push_back (record);
|
|
|
|
|
}
|
|
|
|
@ -206,14 +209,14 @@ namespace CSMWorld
|
|
|
|
|
LocalIndex searchId (const std::string& id) const;
|
|
|
|
|
|
|
|
|
|
void erase (int index, int count);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void insertRecord(CSMWorld::RecordBase& record, CSMWorld::UniversalId::Type type, const std::string& id);
|
|
|
|
|
|
|
|
|
|
const RecordBase& getRecord (const LocalIndex& index) const;
|
|
|
|
|
|
|
|
|
|
RecordBase& getRecord (const LocalIndex& index);
|
|
|
|
|
|
|
|
|
|
void appendRecord (UniversalId::Type type, const std::string& id);
|
|
|
|
|
void appendRecord (UniversalId::Type type, const std::string& id, bool base);
|
|
|
|
|
|
|
|
|
|
int getAppendIndex (UniversalId::Type type) const;
|
|
|
|
|
|
|
|
|
|