1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 22:53:53 +00:00
openmw/apps/opencs/model/world/subcellcollection.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1,013 B
C++
Raw Normal View History

2014-10-04 13:36:52 +00:00
#ifndef CSM_WOLRD_SUBCOLLECTION_H
#define CSM_WOLRD_SUBCOLLECTION_H
#include "nestedidcollection.hpp"
2015-04-09 09:29:03 +00:00
namespace ESM
{
class ESMReader;
}
2014-10-04 13:36:52 +00:00
namespace CSMWorld
{
struct Cell;
2014-10-04 13:36:52 +00:00
/// \brief Single type collection of top level records that are associated with cells
template <typename ESXRecordT>
class SubCellCollection final : public NestedIdCollection<ESXRecordT>
2014-10-04 13:36:52 +00:00
{
const IdCollection<Cell>& mCells;
2014-10-04 13:36:52 +00:00
2024-06-12 15:09:28 +00:00
void loadRecord(ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted, bool base) override;
2014-10-04 13:36:52 +00:00
public:
SubCellCollection(const IdCollection<Cell>& cells);
2014-10-04 13:36:52 +00:00
};
template <typename ESXRecordT>
2024-06-12 15:09:28 +00:00
void SubCellCollection<ESXRecordT>::loadRecord(
ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted, bool base)
2014-10-04 13:36:52 +00:00
{
record.load(reader, isDeleted, mCells);
2014-10-04 13:36:52 +00:00
}
template <typename ESXRecordT>
SubCellCollection<ESXRecordT>::SubCellCollection(const IdCollection<Cell>& cells)
2014-10-04 13:36:52 +00:00
: mCells(cells)
{
}
}
#endif