1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/opencs/model/world/subcellcollection.hpp
2022-09-22 21:35:26 +03:00

42 lines
1.1 KiB
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, typename IdAccessorT = IdAccessor<ESXRecordT>>
class SubCellCollection : public NestedIdCollection<ESXRecordT, IdAccessorT>
{
const IdCollection<Cell, IdAccessor<Cell>>& mCells;
void loadRecord(ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted) override;
public:
SubCellCollection(const IdCollection<Cell, IdAccessor<Cell>>& cells);
};
template <typename ESXRecordT, typename IdAccessorT>
void SubCellCollection<ESXRecordT, IdAccessorT>::loadRecord(
ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted)
{
record.load(reader, isDeleted, mCells);
}
template <typename ESXRecordT, typename IdAccessorT>
SubCellCollection<ESXRecordT, IdAccessorT>::SubCellCollection(const IdCollection<Cell, IdAccessor<Cell>>& cells)
: mCells(cells)
{
}
}
#endif