2014-10-04 13:36:52 +00:00
|
|
|
#ifndef CSM_WOLRD_SUBCOLLECTION_H
|
|
|
|
#define CSM_WOLRD_SUBCOLLECTION_H
|
|
|
|
|
2015-04-11 03:54:05 +00:00
|
|
|
#include "nestedidcollection.hpp"
|
2015-04-09 09:29:03 +00:00
|
|
|
|
2015-02-09 15:50:34 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
}
|
2014-10-04 13:36:52 +00:00
|
|
|
|
|
|
|
namespace CSMWorld
|
|
|
|
{
|
2015-02-09 15:50:34 +00:00
|
|
|
struct Cell;
|
|
|
|
|
2014-10-04 13:36:52 +00:00
|
|
|
/// \brief Single type collection of top level records that are associated with cells
|
2023-02-25 12:11:31 +00:00
|
|
|
template <typename ESXRecordT>
|
2023-02-27 23:22:47 +00:00
|
|
|
class SubCellCollection final : public NestedIdCollection<ESXRecordT>
|
2014-10-04 13:36:52 +00:00
|
|
|
{
|
2023-02-25 12:11:31 +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:
|
2023-02-25 12:11:31 +00:00
|
|
|
SubCellCollection(const IdCollection<Cell>& cells);
|
2014-10-04 13:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-25 12:11:31 +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
|
|
|
{
|
2015-07-21 17:25:43 +00:00
|
|
|
record.load(reader, isDeleted, mCells);
|
2014-10-04 13:36:52 +00:00
|
|
|
}
|
|
|
|
|
2023-02-25 12:11:31 +00:00
|
|
|
template <typename ESXRecordT>
|
|
|
|
SubCellCollection<ESXRecordT>::SubCellCollection(const IdCollection<Cell>& cells)
|
2014-10-04 13:36:52 +00:00
|
|
|
: mCells(cells)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|