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

43 lines
1.3 KiB
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, typename IdAccessorT = IdAccessor<ESXRecordT> >
class SubCellCollection : public NestedIdCollection<ESXRecordT, IdAccessorT>
2014-10-04 13:36:52 +00:00
{
2022-08-19 17:19:42 +00:00
const IdCollection<Cell, IdAccessor<Cell>>& mCells;
2014-10-04 13:36:52 +00:00
void loadRecord (ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted) override;
2014-10-04 13:36:52 +00:00
public:
2022-08-19 17:19:42 +00:00
SubCellCollection(const IdCollection<Cell, IdAccessor<Cell>>& cells);
2014-10-04 13:36:52 +00:00
};
template<typename ESXRecordT, typename IdAccessorT>
void SubCellCollection<ESXRecordT, IdAccessorT>::loadRecord (ESXRecordT& record,
ESM::ESMReader& reader,
bool& isDeleted)
2014-10-04 13:36:52 +00:00
{
record.load (reader, isDeleted, mCells);
2014-10-04 13:36:52 +00:00
}
template<typename ESXRecordT, typename IdAccessorT>
SubCellCollection<ESXRecordT, IdAccessorT>::SubCellCollection (
2022-08-19 17:19:42 +00:00
const IdCollection<Cell, IdAccessor<Cell>>& cells)
2014-10-04 13:36:52 +00:00
: mCells (cells)
{}
}
#endif