2010-08-06 20:20:20 +00:00
|
|
|
#ifndef GAME_MWCLASS_CONTAINERUTIL_H
|
|
|
|
#define GAME_MWCLASS_CONTAINERUTIL_H
|
|
|
|
|
|
|
|
#include <components/esm_store/cell_store.hpp>
|
|
|
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
#include "../mwworld/containerstore.hpp"
|
|
|
|
|
|
|
|
namespace MWClass
|
|
|
|
{
|
|
|
|
template<typename T>
|
|
|
|
void insertIntoContainerStore (const MWWorld::Ptr& ptr,
|
|
|
|
ESMS::CellRefList<T, MWWorld::RefData>& containerStore)
|
|
|
|
{
|
|
|
|
if (!ptr.isEmpty())
|
|
|
|
{
|
|
|
|
// TODO check stacking
|
|
|
|
|
2011-11-08 00:08:00 +00:00
|
|
|
ESMS::LiveCellRef<T, MWWorld::RefData> cellRef(ptr.getCellRef(), ptr.get<T>()->base);
|
2010-08-06 20:20:20 +00:00
|
|
|
cellRef.mData = ptr.getRefData();
|
|
|
|
|
|
|
|
containerStore.list.push_back (cellRef);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|