1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:23:54 +00:00
openmw/apps/opencs/model/world/subcellcollection.hpp
2024-06-12 17:09:28 +02:00

41 lines
1,013 B
C++

#ifndef CSM_WOLRD_SUBCOLLECTION_H
#define CSM_WOLRD_SUBCOLLECTION_H
#include "nestedidcollection.hpp"
namespace ESM
{
class ESMReader;
}
namespace CSMWorld
{
struct Cell;
/// \brief Single type collection of top level records that are associated with cells
template <typename ESXRecordT>
class SubCellCollection final : public NestedIdCollection<ESXRecordT>
{
const IdCollection<Cell>& mCells;
void loadRecord(ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted, bool base) override;
public:
SubCellCollection(const IdCollection<Cell>& cells);
};
template <typename ESXRecordT>
void SubCellCollection<ESXRecordT>::loadRecord(
ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted, bool base)
{
record.load(reader, isDeleted, mCells);
}
template <typename ESXRecordT>
SubCellCollection<ESXRecordT>::SubCellCollection(const IdCollection<Cell>& cells)
: mCells(cells)
{
}
}
#endif