mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 21:40:15 +00:00
Merge branch 'cs_cleanup' into 'master'
Cleanup inheritance and id related editor code See merge request OpenMW/openmw!2781
This commit is contained in:
commit
136a3c6f77
@ -51,7 +51,7 @@ namespace CSMWorld
|
|||||||
return ESM::RefId::stringRefId(Land::createUniqueRecordId(record.mX, record.mY));
|
return ESM::RefId::stringRefId(Land::createUniqueRecordId(record.mX, record.mY));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setRecordId(LandTexture& record, const ESM::RefId& id)
|
inline void setRecordId(const ESM::RefId& id, LandTexture& record)
|
||||||
{
|
{
|
||||||
int plugin = 0;
|
int plugin = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@ -100,7 +100,7 @@ namespace CSMWorld
|
|||||||
public:
|
public:
|
||||||
Collection();
|
Collection();
|
||||||
|
|
||||||
virtual ~Collection();
|
~Collection() override;
|
||||||
|
|
||||||
void add(const ESXRecordT& record);
|
void add(const ESXRecordT& record);
|
||||||
///< Add a new record (modified)
|
///< Add a new record (modified)
|
||||||
@ -119,10 +119,10 @@ namespace CSMWorld
|
|||||||
|
|
||||||
const ColumnBase& getColumn(int column) const override;
|
const ColumnBase& getColumn(int column) const override;
|
||||||
|
|
||||||
virtual void merge();
|
void merge();
|
||||||
///< Merge modified into base.
|
///< Merge modified into base.
|
||||||
|
|
||||||
virtual void purge();
|
void purge();
|
||||||
///< Remove records that are flagged as erased.
|
///< Remove records that are flagged as erased.
|
||||||
|
|
||||||
void removeRows(int index, int count) override;
|
void removeRows(int index, int count) override;
|
||||||
|
@ -276,19 +276,6 @@ void CSMWorld::RefCollection::removeRows(int index, int count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMWorld::RefCollection::appendBlankRecord(const std::string& id, UniversalId::Type type)
|
|
||||||
{
|
|
||||||
auto record = std::make_unique<Record<CellRef>>();
|
|
||||||
|
|
||||||
record->mState = Record<CellRef>::State_ModifiedOnly;
|
|
||||||
record->mModified.blank();
|
|
||||||
|
|
||||||
record->get().mId = ESM::RefId::stringRefId(id);
|
|
||||||
record->get().mIdNum = extractIdNum(id);
|
|
||||||
|
|
||||||
Collection<CellRef>::appendRecord(std::move(record));
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSMWorld::RefCollection::appendBlankRecord(const ESM::RefId& id, UniversalId::Type type)
|
void CSMWorld::RefCollection::appendBlankRecord(const ESM::RefId& id, UniversalId::Type type)
|
||||||
{
|
{
|
||||||
auto record = std::make_unique<Record<CellRef>>();
|
auto record = std::make_unique<Record<CellRef>>();
|
||||||
@ -316,11 +303,6 @@ void CSMWorld::RefCollection::cloneRecord(
|
|||||||
insertRecord(std::move(copy), getAppendIndex(destination, type)); // call RefCollection::insertRecord()
|
insertRecord(std::move(copy), getAppendIndex(destination, type)); // call RefCollection::insertRecord()
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSMWorld::RefCollection::searchId(std::string_view id) const
|
|
||||||
{
|
|
||||||
return searchId(extractIdNum(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
int CSMWorld::RefCollection::searchId(const ESM::RefId& id) const
|
int CSMWorld::RefCollection::searchId(const ESM::RefId& id) const
|
||||||
{
|
{
|
||||||
return searchId(extractIdNum(id.getRefIdString()));
|
return searchId(extractIdNum(id.getRefIdString()));
|
||||||
|
@ -34,7 +34,7 @@ namespace CSMWorld
|
|||||||
void Collection<CellRef>::insertRecord(std::unique_ptr<RecordBase> record, int index, UniversalId::Type type);
|
void Collection<CellRef>::insertRecord(std::unique_ptr<RecordBase> record, int index, UniversalId::Type type);
|
||||||
|
|
||||||
/// \brief References in cells
|
/// \brief References in cells
|
||||||
class RefCollection : public Collection<CellRef>
|
class RefCollection final : public Collection<CellRef>
|
||||||
{
|
{
|
||||||
Collection<Cell>& mCells;
|
Collection<Cell>& mCells;
|
||||||
std::map<unsigned int, int> mRefIndex; // CellRef index keyed by CSMWorld::CellRef::mIdNum
|
std::map<unsigned int, int> mRefIndex; // CellRef index keyed by CSMWorld::CellRef::mIdNum
|
||||||
@ -61,20 +61,19 @@ namespace CSMWorld
|
|||||||
|
|
||||||
std::string getNewId();
|
std::string getNewId();
|
||||||
|
|
||||||
virtual void removeRows(int index, int count);
|
void removeRows(int index, int count) override;
|
||||||
|
|
||||||
virtual void appendBlankRecord(const std::string& id, UniversalId::Type type = UniversalId::Type_None);
|
void appendBlankRecord(const ESM::RefId& id, UniversalId::Type type = UniversalId::Type_None) override;
|
||||||
virtual void appendBlankRecord(const ESM::RefId& id, UniversalId::Type type = UniversalId::Type_None);
|
|
||||||
|
|
||||||
virtual void cloneRecord(const ESM::RefId& origin, const ESM::RefId& destination, const UniversalId::Type type);
|
void cloneRecord(
|
||||||
|
const ESM::RefId& origin, const ESM::RefId& destination, const UniversalId::Type type) override;
|
||||||
|
|
||||||
virtual int searchId(std::string_view id) const;
|
int searchId(const ESM::RefId& id) const override;
|
||||||
virtual int searchId(const ESM::RefId& id) const;
|
|
||||||
|
|
||||||
virtual void appendRecord(std::unique_ptr<RecordBase> record, UniversalId::Type type = UniversalId::Type_None);
|
void appendRecord(std::unique_ptr<RecordBase> record, UniversalId::Type type = UniversalId::Type_None) override;
|
||||||
|
|
||||||
virtual void insertRecord(
|
void insertRecord(
|
||||||
std::unique_ptr<RecordBase> record, int index, UniversalId::Type type = UniversalId::Type_None);
|
std::unique_ptr<RecordBase> record, int index, UniversalId::Type type = UniversalId::Type_None) override;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace CSMWorld
|
|||||||
|
|
||||||
/// \brief Single type collection of top level records that are associated with cells
|
/// \brief Single type collection of top level records that are associated with cells
|
||||||
template <typename ESXRecordT>
|
template <typename ESXRecordT>
|
||||||
class SubCellCollection : public NestedIdCollection<ESXRecordT>
|
class SubCellCollection final : public NestedIdCollection<ESXRecordT>
|
||||||
{
|
{
|
||||||
const IdCollection<Cell>& mCells;
|
const IdCollection<Cell>& mCells;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user